Create a new mysql user and grant all privileges to them on a database

The fol­low­ing com­mand will cre­ate a new user and grant them all the per­mis­sions on a database.

grant all privileges on database_name.* to 'username'@'localhost' identified by 'secure_password';

To list the per­mis­sions granted to a user

show grants for 'username'@'localhost';

Ryan Sukale

Ryan is a UX engineer living in San Francisco, California.

You may also like...