X

Add MySQL User | Give them Permissions On a Database


This simple guide demonstrates adding a new user to mysql and giving that user full access rights to a particular db within MySQL. This is really useful when you want to create a new database user for a new wordpress isntall.

You can do this from the command line of your server if you login with:
mysql -u root -p
Or you can do it from within phpmyadmin (phpmyadmin is probably the best option if you are using a web hosting account)

Before you create the new user, you will want to create a new database (you can do that from the main page of phpmyadmin)
Use the following 2 lines to create a new user named sammy with password strong_password and give him full access rights for the database called MY_DB
CREATE USER 'sammy'@'localhost' IDENTIFIED BY 'strong_password';
GRANT ALL PRIVILEGES ON MY_DB.* TO 'sammy'@'localhost' WITH GRANT OPTION;

A:
Disqus Comments Loading...