Grant privileges to a Mysql user?
HowTo GRANT privileges to a Mysql user?
Create a database:
mysql> create database dbname;
and grant the privileges using the following query:
mysql> grant all on dbname.* to ‘dbuser’@’localhost’ identified by ‘password’;
The user ‘dbuser’ will now have access to database ‘dbname’ locally using the password ‘password’. Using the above command, you can also allow new users to access your database as well. Just replace the ‘dbuser’ and ‘password’ with the new user and password.
To allow the user to access the database remotely say from IP 111.222.333.444, execute:
mysql> grant all on dbname.* to ‘dbuser’@’111.222.333.444‘ identified by ‘password’;