Sunday, 9 September 2018

How to Grant Privileges to a User in MySQL



To grant privileges to a database user account, the GRANT statement can use to provide requires access grants to the user.

Run the following the GRANT statement to grant the access:

mysql> GRANT ALL PRIVILEGES ON *.* TO user@<IP address / hostname>;

Execute the following query to reload privileges:

mysql> FLUSH PRIVILEGES;

Verify the privileges using following MySQL SHOW statement for user:

mysql> SHOW GRANTS FOR username@<IP address/hostname>;

It’s done!

No comments:

Post a comment