MySQL doesn't work anymore, i cannot use it to do a backup, so how can i do a backup? Do I only have to save the files in /var/lib/mysql and then restore or do i have to do others things? Thanks for the answer
3 Answers
If your database is "broken", a backup of it will be broken too. You can, for safe keeping, copy the whole structure under /var/lib/mysql. But in all probability, you can't recover from it. Specially if you used InnoDB tables.
I'm assuming your server is not starting. You really have to debug why. Enable a log in your my.cnf and look at the error log to see why it's not starting. Then you can try to address that and start your mysql.
If you can get the error log with the exact message up, there is a chance that we can fix it and start your DB. Then you can have a proper mysqldump backup

- 1,803
- 1
- 10
- 12
Yeah, you can copy /var/lib/mysql and you should be fine, although other methods are preferred if you can use them.

- 743
- 6
- 20
Check if any of these methods help you in solving the issue:
How to backup all files related to mysql - Restoring MySQL database from physical files
If MySQL has stopped due to InnoDB corruption then here are the steps to resolve it - https://support.plesk.com/hc/en-us/articles/213939865-InnoDB-corruption-cases-for-the-MySQL-database
Check this https://dev.mysql.com/doc/mysql-backup-excerpt/5.5/en/innodb-backup.html to know more about backup methods.