backup

Backup and Restore MySQL from the command line (CLI)

I use MySQL.  I like MySQL... but I don't trust MySQL. 

Actually, I don't trust anything computer-based, its nothing against MySQL at all... so I like to back up my databases from time to time.

Now because I have my own server, I can use the command line to do most of my management, which I prefer,  but try as I might the backup and restore commands escape me every time I go to use them... so here they are, just for me (and you too)

to back up:

mysqldump -u username -p databasename > backupfile.sql

To restore: