24 Aug

Backup All Databases in MySQL

Backup all files in /var/lib/mysql to another folder

To restore, stop mysqld if it is running

service stop mysqld

Move all database files back to /var/lib/mysql. Make sure that all the folder and files in that folder belongs to mysql

chown -R mysql.mysql /var/lib/mysql

Try starting mysql

service start mysqld

One thought on “Backup All Databases in MySQL

Leave a Reply

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