docs:mysql:grant

This is an old revision of the document!


MySQL Users

  • This is better known as privileges
SHOW GRANTS [FOR user];
 
SHOW GRANTS;
SHOW GRANTS FOR 'root'@'localhost';
SHOW GRANTS FOR CURRENT_USER;
SHOW GRANTS FOR CURRENT_USER();
  • Global Privileges (all databases and tables):
    GRANT ALL PRIVILEGES ON *.* TO username@localhost
    IDENTIFIED BY 'password';
  • Global Privileges for “acme” database (and all acme tables):
    GRANT ALL PRIVILEGES ON acme.* TO username@localhost
    IDENTIFIED BY 'password';

You need to flush privileges after manually making changes to user tables.

FLUSH PRIVILEGES;
  • docs/mysql/grant.1174426680.txt.gz
  • Last modified: 2008/08/03 00:25
  • (external edit)