InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes
来源:互联网 发布:淘宝半价群是真的吗 编辑:程序博客网 时间:2024/06/06 02:50
1.版本
1)操作系统
cat /etc/issue
Red Hat Enterprise Linux Server release 5.5 (Tikanga)
Kernel \r on an \m
cat /proc/version
Linux version 2.6.32-504.el6.x86_64 (mockbuild@c6b9.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC) ) #1 SMP Wed
2)mysql数据库版本
mysql --version
mysql Ver 14.14 Distrib 5.1.73, for redhat-linux-gnu (x86_64) using readline 5.1
2.问题描述
一次在修改my.cnf文件后重启mysql实例发现如下错误:
mysql> desc cMxxPxhCoxf;ERROR 1286 (42000): Unknown table engine 'InnoDB'查看errlog发现如下报错:
<span style="color:#333333;">151202 18:18:36 mysqld_safe Starting mysqld daemon with databases from /data/mysql/usr/libexec/mysqld: Table 'mysql.plugin' doesn't exist151202 18:18:36 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.151202 18:18:36 InnoDB: Initializing buffer pool, size = 3.9G151202 18:18:37 InnoDB: Completed initialization of buffer pool</span><span style="color:#ff0000;">InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes >>因为我们cnf文件中指定的innodb log size和之前不一致</span><span style="color:#333333;">InnoDB: than specified in the .cnf file 0 67108864 bytes!151202 18:18:37 [ERROR] Plugin 'InnoDB' init function returned error.151202 18:18:37 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.151202 18:18:37 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist151202 18:18:37 [ERROR] Column count of mysql.db is wrong. Expected 22, found 20. Created with MySQL 50157, now running 50173. Please use mysql_upgrade to fix this error.151202 18:18:37 [ERROR] mysql.user has no `Event_priv` column at position 29151202 18:18:37 [ERROR] Cannot open mysql.event151202 18:18:37 [ERROR] Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.151202 18:18:37 [Note] /usr/libexec/mysqld: ready for connections.Version: '5.1.73-log' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution</span>##从上面标红我们可以知道问题是因为修改my.cnf文件中修改了innodb_log_file_size值,在5.6之前如果要修改innodb_log_file_size值,需要先移走已有的ib_logfile文件,否则启动就会报上面的错,从而导致innodb的表不能使用。
3.问题解决
3.1 方案1
3.1.1 停mysql实例
mysqladmin -uroot -p -S /var/lib/mysql/mysql.sock shutdown
3.1.2 修改my.cnf文件中innodb_log_file_size值为原来值
即修改innodb_log_file_size=5242880
3.1.3 以修改后的my.cnf重启mysql实例
mysqld_safe --defaults-file=/etc/my.cnf &
3.2 方案2
3.2.1 停mysql实例
mysqladmin -uroot -p -S /var/lib/mysql/mysql.sock shutdown
3.2.2 修改原有ib_logfile文件名
mv ib_logfile0 ib_logfile0.bak
mv ib_logfile1 ib_logfile1.bak
3.2.3 启动mysql实例
mysqld_safe --defaults-file=/etc/my.cnf &
- InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes
- InnoDB: Error: log file .\ib_logfile0 is of different size 0 10485760 bytes
- InnoDB: Error: log file ./ib_logfile0 is of different size 50331648 bytes
- Mysql启动中 InnoDB: Error: log file ./ib_logfile0 is of different size 0
- Mysql启动中 InnoDB: Error: log file ./ib_logfile0 is of different size 0
- Fixing “InnoDB: Error: log file ./ib_logfile0 is of different size” Error
- InnoDB: Error: log file /home/mysqldata/ib_logfile0 is of different size
- xtrabackup 恢复出现错误InnoDB: Error: log file ./ib_logfile2 is of different size 0 0 bytes
- [ERROR] InnoDB: Data file /data/mysql/3310/data/ibdata1 is of a different size 1536 pages
- mysqld_safe 启动、usr/local/mysql/data/ib_logfile0 is of different size ...的错误
- InnoDB: The Auto-extending innodb_system data file './ibdata1' is of a different size 640 pages
- The database page size of 4096 bytes obtained from ASE is different from the database page size of 2
- The count of VLFs for different size of transaction log
- Fatal error: Allowed memory size of 8388608 bytes exhausted
- Fatal error: Allowed memory size of 8388608 bytes exhausted
- Fatal error: Allowed memory size of 20971520 bytes exhausted
- Fatal error: Allowed memory size of 8388608 bytes exhausted解决方法
- Fatal error: Allowed memory size of *** bytes exhausted
- Android ListView使用BaseAdapter 优化
- java设计模式之单例模式
- mysql 使用federated 引擎实现dblink 远程表访问
- EventKit
- 双目立体视觉系统精度分析
- InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes
- js入门(十)——原型
- 线程池配合RecyclerView实现从网上加载大量图片显示
- 我对JS的理解
- oc中的copy与mutableCopy
- fzu月赛(2015.11)
- 机器学习维度灾难(二)
- 人间情味
- videoPlayer 无法播放视频