Easy MySql backup and restore
It’s been awhile and I thought it was good time to backup my MySql database from my web host provider. I wanted a complete backup of all the tables and data since there weren’t any before (I know, playing with fire).
For the backup, you can use a handy program called mysqldump that is included with MySql. You can run this program remotely, and it will generate all the create table and insert‚ statements required to rebuild the database. Here is the command-line:
>mysqldump -u username -p -h sqlserver.host.com databasename > output.sql
And restoring is even simpler:
>mysql -u username -p db_to_restore_to And that’s all there is to it. Nice and simple.