MySQL Cheat Sheet
Provided by Leumas Naypoka / www.apphp.com
Here are the most commonly used SQL commands and the most commonly used options for each. There are many more commands and options than listed here. In other words, the syntaxes as I have listed them are far from complete. See the links at the bottom for more complete syntaxes and more commands.This sample demonstrates how to do a backup of your database.
mysqldump -u USER -pPASSWORD DATABASE > /path/to/file/dump.sql
This sample shows how to create a database structure without data.
mysqldump --no-data - u USER -pPASSWORD DATABASE > /path/to/file/schema.sql
If you want to dump only one or few tables.
mysqldump -u USER -pPASSWORD DATABASE TABLE1 TABLE2 TABLE3 > /path/to/file/dump_table.sql
Create a backup and archive it.
mysqldump -u USER -pPASSWORD DATABASE | gzip > /path/to/outputfile.sql.gz
To be continued...