Friday, September 26, 2008

Adding new user for mysql server

Always after I configured a mysql server in a machine (I have to do it once a month mostly as people always ask me to do so in their machines... ) I have to search the web (specially mysql website) and see how to add the new user including password for that syste.

So I thought its better to put it in my blog so I just want to search in my blog only rather than going through the mysql website.

After creating the mysql database you have to create the root password for the system. For that run the following commands from the mysql folder (You need to start the mysql server before issuing those):
./bin/mysqladmin -u root password 'new password'
./bin/mysqladmin -u root -h password 'new password'

Then login to mysql (mysql -u root -p ) and issue following commands to create new users.

GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost' IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%' IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
GRANT RELOAD,PROCESS ON *.* TO 'admin'@'localhost';
GRANT USAGE ON *.* TO 'dummy'@'localhost';

Hope this information is useful to all of you...

~ Vidula Hasaranga - විදුල හසරංග ~


Post a Comment