Monday, October 7, 2013

How to create new user on linux for mysql

First login as 'root' on your linux machine.

Go to mysql terminal and use these commands to create a new user.

mysql> create user ''@'localhost' identified by '';

mysql> grant all privileges on  * . * to ''@'localhost';

mysql> flush privileges;

Now go back to your console and login using the created username and password using this command:

$mysql -u -p

Thats all!! And you are good to use this username and password and work on databases.