Menu Home

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

Categories: Linux

Basri MY

1 reply

Leave a Reply

Your email address will not be published. Required fields are marked *