MySQL守护程序无法启动。 ib_logfile的大小不同

时间:2015-10-15 07:01:24

标签: mysql

请帮帮我。

服务器:AWS ec2

问题:

#sudo service mysqld start

MySQL Daemon failed to start.
Starting mysqld:                                           [FAILED]

vi /var/log/mysqld.log:

151015 05:46:26 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
151015  5:46:26 [Note] /usr/libexec/mysql55/mysqld (mysqld 5.5.45) starting as process 14873 ...
151015  5:46:26 [Warning] option 'innodb-buffer-pool-size': signed value 1048576 adjusted to 5242880
151015  5:46:26 [Note] Plugin 'FEDERATED' is d151015 05:46:26 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
151015 05:46:42 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
151015  5:46:42 [Note] /usr/libexec/mysql55/mysqld (mysqld 5.5.45) starting as process 15133 ...
151015  5:46:42 [Note] Plugin 'FEDERATED' is disabled.
151015  5:46:42 InnoDB: The InnoDB memory heap is disabled
151015  5:46:42 InnoDB: Mutexes and rw_locks use GCC atomic builtins
151015  5:46:42 InnoDB: Compressed tables use zlib 1.2.8
151015  5:46:42 InnoDB: Using Linux native AIO
151015  5:46:42 InnoDB: Initializing buffer pool, size = 128.0M
151015  5:46:42 InnoDB: Completed initialization of buffer pool
InnoDB: Error: log file ./ib_logfile0 is of different size 0 0 bytes
InnoDB: than specified in the .cnf file 0 5242880 bytes!
151015  5:46:42 [ERROR] Plugin 'InnoDB' init function returned error.
151015  5:46:42 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
151015  5:46:42 [ERROR] Unknown/unsupported storage engine: InnoDB
151015  5:46:42 [ERROR] Aborting

151015  5:46:42 [Note] /usr/libexec/mysql55/mysqld: Shutdown complete

151015 05:46:42 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

谢谢!

2 个答案:

答案 0 :(得分:0)

这是你的错误:

  

InnoDB:错误:日志文件./ib_logfile0的大小为0 0字节   InnoDB:比.cnf文件中指定的0 5242880字节!

您可以将innodb-log-file-size文件中my.cnf的值调整为日志文件的大小(我想是512M),或者只删除文件ib_logfile0和{{1在你的MySQL文件夹中(很可能是ib_logfile1)让MySQL自动重新创建它们。

答案 1 :(得分:0)

大多数情况下,这是因为您的磁盘空间已满。检查空间运行..

df  

尝试在某处检查日志文件。或者运行以下命令查找大文件......

sudo find / -xdev -type f -size +100M

清理磁盘空间后,请尝试重新启动mysql ...

sudo service mysqld restart

如果仍然有错误,请尝试移动iblog文件,然后重新启动mysql ...

sudo mv /var/lib/mysql/ib_logfile* ~/
sudo service mysqld restart

对于这个问题,应该是90%的情况。我会避免过多地搞乱你的my.cnf文件。最糟糕的是COPY IT并暂时放入一个非常基本的版本以获得更多调试...

sudo vi /my/etc.cnf

[mysqld_safe]
log_error=/var/log/mysql_error.log

[mysqld]
log_error=/var/log/mysqld_error.log