For PostgreSQL we already have a cheatsheet. Time to make one for MySQL.
Okey, for schema here I am refer to an exact database name. Just briefly without explanation as some commands are self-descriptive. Btw, I think that everyone who works with Databases should have it’s own cheat sheet.
Working with mysql console
Logging to console
General commands
Commenting (usefull in *.sql scripts) :
Additional useful commands
Creating Tables
Locking Tables
Table locking is widely used technique of allowing only single client to access the tables for read/write
For dumping mysql I prefer using the following mysql_dump command :
time here is just to measure metrics.
Consider also using very useful --compatible=<name> mysql parameter to specify target export. E.g –compatible=postgresql if you want then to import data in PostgreSQL database.