Rescue Database to export

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.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

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.