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

Author: Binny V A
A philosopher programmer who specializes in backend development and stoicism.

1 thought on “Backup All Databases in MySQL

Leave a Reply

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