Restore MySQL Database from FileSystem Backup


Always backup your MySQL database with mysqldump but if you didn’t you can restore it from file system.

If your backup include the /var/lib/mysql directory, if so then you should be able to restore the database. Each database is contained in a separate subdirectory off /var/lib/mysql, so look for one named with the name of your database (WordPress or any other). To restore it, shutdown the mysql server first

sudo /etc/init.d/mysql stop

Copy the backup-ed directory into the same location on your new server, then restart mysql server

sudo /etc/init.d/mysql start

Note:- أنه من الأفضل بكثير أخذ مقالب قاعدة البيانات الفعلية باستخدام الأمر mysqldump من الاعتماد على هذه الطريقة,,en,لذلك في المستقبل,,en,يجب عليك جدولة شيء من هذا القبيل,,en,استعادة قاعدة بيانات MySQL من FileSystem Backup,,en. so for the future, you should schedule something like this:

mysqldump -h host -u user -ppassword --databases database1 database2 > myfile.dump



Leave a Reply