Setting up this site required a MySQL database, so I’m documenting some commonly used commands.
Connect to MySQL as root user in terminalmysql -u root -p
Show all databasesSHOW DATABASES;
Create database XXXXXCREATE DATABASE XXXXX;
Select database XXXXXUSE XXXXX;
Show all tables in current databaseSHOW TABLES;
Create new user XXXXX with password YYYYYCREATE USER 'XXXXX'@'localhost' IDENTIFIED BY 'YYYYY';
Allow user ZZZZZ to access database XXXXX (or * for all databases) and table YYYYY (or * for all tables)GRANT ALL PRIVILEGES ON XXXXX . YYYYY TO 'ZZZZZ'@'localhost';
Reload permissionsFLUSH PRIVILEGES;