Backup/Restore MySQL Database Linux


Initiating a backup from phpMyAdmin is not always the best solution when are you running a medium to massive web database. If you are running your mysql server on a vps or a dedicated server on Linux, those commands will definitely be useful to you.

Backup:

mkdir -p /backup

cd /backup

mysqldump -u root -p database_name > database_name.dmp

Restore:

cd /backup

mysql -u root -p database_name < database_name.dmp

Gulshan Yashveer Beejan

Gulshan holds a BSc(Hons) Computer Science with Distributed systems from the City University of London. He is currently working at DSOGroup(Mauritius) as a Linux Administrator on SaaS Solutions. More about Gulshan

Leave a Reply

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