Grant All Privileges on a Database in MySQL / MariaDB

 Grant user super privileges on all the Database in MySQL / MariaDB

Grant commands give privileges to the database, table, function, and procedure or all objects present in the database. We use the grant/revoke command to control the access to the given user.

Grant all privileges to a user on a specific Database in MySQL

GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost';
FLUSH PRIVILEGES;

Grant all privileges to a user on all databases in MySQL ( like SuperUser)

GRANT ALL PRIVILEGES ON *.* TO 'username'@'%';
FLUSH PRIVILEGES;

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.