MySQL Snippets

Take a backup

# entire database
mysqldump -p -u username db_name > db_name.sql

# just one table
mysqldump -p -u username db_name table_name > db_name.tabel_name.sql

Load from backup

mysql -p -u username db_name < db_name.sql