Tuesday, August 26, 2014

Create a database and grant all priviliges to a new user with mysql

Log in with password :

  mysql -u root -p

Create a database:

  create database mydatabasename;

Create a user with full privilege on that database :

  grant all on mydatabasename.* to mydatabaseuser@localhost identified by 'somepassword';

That's all folks.