mysql not starting after deleting the database from the mysql datadirectory

Few days back i have mistakenly deleted one database folder directly from the mysql data directory but still the site was working fine. I just wondering how its working? 

So i restarted the mysql service. It stopped but didn’t start and getting below error in the log file

[root@localhost html]# tail -f /var/log/mysqld.log

InnoDB: Error: log file ./ib_logfile0 is of different size 0 84992 bytes

InnoDB: than specified in the .cnf file 0 5242880 bytes!

131001 17:54:45 [ERROR] Plugin ‘InnoDB’ init function returned error.

131001 17:54:45 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed.

131001 17:54:45 [ERROR] Unknown/unsupported storage engine: InnoDB

131001 17:54:45 [ERROR] Aborting

131001 17:54:45 [Note] /usr/libexec/mysqld: Shutdown complete

131001 17:54:45 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

As usual i started searching google and didn’t find any solution and final got one solution. It’s to delete the ib_logfile0, and i deleted it and trying to start the mysql service and it start working  by recreating this file automatically…

What i understand from this, if you going to re-install the mysql or wamp server and to take backup of these databases, you have to follow below instructions,

  1. First stop the mysql service
  2. Copy the database which you need to have backup from the mysql data directory 
  3. Re-install / Install either Mysql or Wamp Server
  4. Stop the mysql service
  5. Paste the database backup in the mysql data directory which you have taken previously
  6. Start the mysql service

This will keep the old database backup easily without any problem and this will avoid importing the database again. May be imporing small database is not a problem, but thing when you have some 1GB or @ GB size of db, then it will take more time to import the database. Following the above steps, will save your time.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: