-1

I had problem starting innodb and read somewhere that deleting ib_logfile0,ib_logfile1 files works. It worked and mysql started again and when I use "Show tables" it shows all tables of my database but when I run the "Select * from db1.table1" it says that table does not exists.

Would you help me ? the database file still exist at "/var/lib/mysql"

  • 1
    you have deleted your data, understand what things are before blowing them up – Sum1sAdmin Apr 30 '16 at 10:46
0

You just deleted datafiles for your DB. MySQL has structure of DBs and data in separated files. Your database left with structure files (so it know about databases and tables) but your data are gone. You have to restore your database from backup.

Good to know for next try - you should validate anything from the Internet with documentation of your software to avoid running destructive opperation and keep your data safe.

  • How Could I recover it If I have no backup at all ? – Babak Fakhriloo Apr 30 '16 at 11:24
  • If you have no backup, I unfortunatelly have to say your data are gone. You can try some data rescue service but I think they can't help you too because those files need to be rescued in perfect shape without any byte damaged. You definitelly should have some backups if it is production environment, take it as lesson to you (I just can hope this lesson is not so expensive for you and your company). – Ondra Sniper Flidr Apr 30 '16 at 11:34
  • 1
    That's not exactly the case. Actually we (twindb provides mysql data rescue service) can fetch data from deleted files on a disk image. The files don't need to be in perfect shape as you say. We don't care about a great deal of headers but the actual data must be on disk. – akuzminsky May 2 '16 at 6:11
0

Basically the files ib_logfile0,ib_logfile1 contains the databse table structure and responsible for identifying the path for database connection. You will be able to find all the databases in /var/lib/mysql but all the tables using innoDB database engine are corrupted and will show the database connection error, because of removal of ib_logfile0,ib_logfile1.

Therefore you have to recover table structure from .frm files with MySQL Utilities

I am sharing one link rest you have to find.

https://www.percona.com/blog/2014/01/02/recover-table-structure-frm-files-mysql- utilities

Other way is backup your all databases and try to recover it with force recovery.

edit

my.cnf file

and add beow line in your mysql configuration file

innodb_force_recovery = 1

now, start the mysql service. Under the mysqld section of the config file you can add innodb_force_recovery = 0 – 6.

Levels 1-4 are pretty safe as most data is preserved. Setting the level to 5 or 6 gets a bit more risky as you could lose some data.

Wish you LUCK.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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