24 Aug

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”

1. I use this method only after an OS reinstall. There are easier ways to do a simple database backup.