Backup/restore mysql with command line via SSH

To backup:

mysqldump -u[user] -p [db name] > file.sql

Example: mysqldump -ujoe -p joesdb > file.sql

Notes there is no space between “-u” and “user”.

To restore:

mysql -u [user] -p [db name] < file.sql Example: mysql -u joe -p joesdb < file.sql

Prev PostMYNIC user interface is getting better, but still not so good
Next PostUbuntu, LAMP, Webmin & Virtualmin - do you need all those?

Leave a reply