Rescue Database to export

April 30, 2019 167 views
DigitalOcean

I have tried copying /var/lib/mysql/ the files, but it doesn’t work well, after copying the files and Ib file, my table doesn’t show up, it said they don’t exist, even I changed the permission though. I am not sure what went wrong, it could be the problem with the version of MySQL. I don’t know the version of MySQL what I had the data, my current database server version is 5.7.26 which I am loading it.

So, I would like to know how to export rather than copying which I am stuck doing. Mysql is still in /mnt/usr/bin. How can I run them, in order to export all the databases, can you please tell me step by step for rescue mode.

1 Answer

On Linux server, use terminal command
mysqldump -u YourUser -p YourDatabaseName > wantedsqlfile.sql

This command will export the database to the current directory that you are in. You will be prompted for password for the user.

Create a snapshot / backup of your server beforehand incase anything goes wrong.

Have another answer? Share your knowledge.