Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

InnoDB Error in Mysql

Tags:

mysql

innodb

Last night the server was upgraded from a MySQL server with InnoDB Cpanel have much of a problem when MySQL server will shut down! Because many of the sites on vps in their database to InnoDB Engine Table Does not have put up their site and say

error: Unknown table engine 'InnoDB' 

Error

It will enable the mysql server but it did not put the InnoDB! The mysql command

show engines; 

I noticed the following result which is not InnoDB Result

mysql> show engines;

 | Engine | Support | Comment | Transactions | XA | Savepoints |

 | MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | NO | NO | NO |
 | MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
 | BLACKHOLE | YES | / dev / null storage engine (anything you write to it disappears) | NO | NO | NO |
 | CSV | YES | CSV storage engine | NO | NO | NO |
 | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
 | FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL |
 | ARCHIVE | YES | Archive storage engine | NO | NO | NO |

 7 rows in set (0.00 sec) 

Log into mysql server gives an error ...

121105 18:26:50 mysqld_safe Starting mysqld daemon with databases from / var / lib / mysql
 121105 18:26:50 [Note] Plugin 'FEDERATED' is disabled.
 121105 18:26:50 InnoDB: Initializing buffer pool, size = 8.0M
 121105 18:26:50 InnoDB: Completed initialization of buffer pool
 InnoDB: Error: log file ./ib_logfile0 is of different size 0 268435456 bytes
 InnoDB: than specified in the. Cnf file 0 536870912 bytes!
 121105 18:26:50 [ERROR] Plugin 'InnoDB' init function returned error.
 121105 18:26:50 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
 121105 18:26:50 [Note] Event Scheduler: Loaded 0 events
 121105 18:26:50 [Note] / usr / sbin / mysqld: ready for connections.
 Version: '5 .1.65-cll 'socket:' / var / lib / mysql / mysql.sock 'port: 3306 MySQL Community Server (GPL)

in my.cnf innodb settings for both are:

 innodb_fast_shutdown = 0
 innodb_log_buffer_size = 8M
 innodb_log_file_size = 512M

Thanks, plz help me to solve the problem.

like image 291
Amir Gholami Avatar asked Nov 06 '12 09:11

Amir Gholami


People also ask

What is InnoDB engine error in MySQL?

The error message itself clearly says that MySQL service is unable to detect the InnoDB storage engine. InnoDB engine error manifests itself in different situations: 1. Failure in creating InnoDB tables Suppose you try to create a new table using the command (“CREATE TABLE t1 (a INT, b CHAR (20), PRIMARY KEY (a)) ENGINE=InnoDB;”).

What happens when InnoDB database goes corrupt?

But at times, when InnoDB databases goes corrupt due to reasons like virus attack, kernel related bugs, unexpected power failure, mysql faults or related ones leading to Innodb assertion failure in thread mysql error and you are not able to access Mysql tables and hence mysql repair innodb is needed.

How to fix InnoDB cannot open the file?

InnoDB: To fix the problem and start mysqld: InnoDB: 1) If there is a permission problem in the file and mysqld cannot InnoDB: open the file, you should modify the permissions.

How to troubleshoot InnoDB data dictionary issues?

If you encounter InnoDB data dictionary failure issues, you will need to resolve “inability to open .InnoDB files”, “failed CREATE TABLE statement” and “system cannot find the path specified” errors. Troubleshooting these errors will enable access to InnoDB data dictionary. 2. Check Table for Errors


1 Answers

From what i see in your logs your InnoDB is broken due to its file ib_logfile0is messed up. I had same problem when hard drive crashed leaving this file unreadable - after reading what i could form the broken drive file was good but data inside was messed out.

InnoDB: Error: log file ./ib_logfile0 is of different size 0 268435456 bytes
InnoDB: than specified in the. Cnf file 0 536870912 bytes!

There it is -> You file is 256 mb size yet your configuration tells it should be 512mb size. Fix the error in the configuration.

Then - backup all yours data (innodb tables with data). Shutdown database (clean shutdown - all transactions must be finished - the log shouldn't contain them in order to make the file bigger). Then backup the ib* file and change configuration. Restart DB.

For more detailed information go there http://dev.mysql.com/doc/refman/5.5/en/innodb-data-log-reconfiguration.html

like image 111
Seti Avatar answered Nov 10 '22 15:11

Seti