Centos – I deleted the database MySQL by mistake

centosMySQL

I am trying to backup an old database, but by mistake I have deleted server database.. the one thing I have done is I have copied MySQL data folder. Is there a way to restore my old database with that?

  • database – MySQL
  • os – centos
  • backup I have – ibdata1, log file 0 and 1,database folder.

I tried changing the size of the log file to the original size and added innodb_force_recovery=6 to my.cnf file then tried but was unsuccessful. It just says that your ibdata1 file is corrupted or you have copied.

Best Answer

if your database tables were created as MyISAM tables then copying the directory and changing permission the owner/group to mysql should work, for innodb type there should be other files in the mysql root directory should be copied, so check that you have copied all files and permission of the files.