0

I have a machine that crashed that contained a VERY important MySQL crash. My automated daily backups were in one of the locations where the data was fragged. So all I have is my physical /var/lib/mysql folder.

SO I installed mariadb on a new server, and copied over my db files. Started Maria DB and see all of my databases. Look at the list of tables, and they're all there. Finally, try to do a mysqldump so i can move these to a new location (different host provider), and none of the Innodb tables are recognized. One of these:

mysqldump: Got error: 1146: "Table 'dbname.tablename' doesn't exist" when using LOCK TABLES

So, I have no actual dumps to restore from or I would, and innodb is not being kind. How can I get access to this data so I can dump it for a new host?

2
  • 2
    "copied over my db files" -- what files exactly did you copy, and how?
    – mustaccio
    Commented Oct 14, 2022 at 21:15
  • And did you have changes to /etc/my.cnf?
    – Rick James
    Commented Oct 14, 2022 at 21:25

1 Answer 1

0

I got this figured.

Originally, I had copied over the old my.cnf and the actual database folders from within the/var/lib/mysql folder. This was showing me the databases and tables inside of MySQL, and I could query the MyIsam tables, but not the innodb tables.

The part I was missing, was to bring over the ibdata1 file from outside of the individual db folders as well (/var/lib/mysql/ibdata1). Once I brought this over and started MySQL, I then had access to the innodb table data. After that, the MySQLDUMP performed perfectly, as well, and I have all of my data.

1
  • Congratulations! You got your database back. Probably. Personally, I'd say you were "Lucky" - this time. Next time, you might not be. Put some time and effort into learning how to manage your Backups and, more importantly, your Restores /properly/.
    – Phill W.
    Commented Oct 18, 2022 at 8:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.