Adding new users to MySQL Databases

#
# Connect to the local database server as user root
# You will be prompted for a password.
#
mysql -h localhost -u root -p

#
# Now we see the ‘mysql>’ prompt and we can run
# the following to create a new database for xmodx.
#
mysql> create database xmodxdb;

#
# Now we create the user xmodx and give him full
# permissions on the new database
mysql> grant CREATE,INSERT,DELETE,UPDATE,SELECT on xmodxdb.* to [email protected];

#
# Next we set a password for this new user
#
mysql> set password for [email protected] = password(‘[email protected]@[email protected]’);

#
# Cleanup and ext
mysql> flush privileges;
mysql> exit;

Leave a Reply

Your email address will not be published. Required fields are marked *