useful mysql commands

Few things I repeatedly look up on the interwebs, keeping here for reference:

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON database1.* TO ‘yourusername’@’localhost’ IDENTIFIED BY ‘yourpassword’;

SHOW GRANTS FOR user@localhost;

SELECT * FROM mysql.user;

Leave a Reply

Your email address will not be published. Required fields are marked *