MySQL snippets

Create a new MySQL database

mysql -u root -p

CREATE DATABASE databaseName;  
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON databaseName.* TO 'databaseUser'@'localhost' IDENTIFIED BY 'dbpassword';  
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON databaseName.* TO 'databaseUser'@'localhost.localdomain' IDENTIFIED BY 'dbpassword';  
FLUSH PRIVILEGES;  
quit;