Custom Search

Sunday, December 21, 2008

Creating a new user in mysql

If we want to create a new user in mysql , we can use the following command.


mysql > create database newdb
> grant all privileges on newdb.* to newuser@"localhost" identified by 'newpassword';


This would create the new user identified by that username and password. This can be validated by logging in again.


mysql > mysql -u newuser -p
Enter password:

So - now we have created this user and password and tested the same.

No comments: