Starting MySQL. ERROR! The server quit without updating PID file (/mnt/mysql/li539.pid).
感觉网站速度很慢,top看mysql进程占用cpu经常飙升100%。打算重启mysql看看,
用service mysql restart; 结果就悲催了,mysql不能正常启动了,提示
Starting MySQL. ERROR! The server quit without updating PID file (/mnt/mysql/li539.pid).
搜了下网上解决办法都没还不行。仔细看mysql的错误日志
161220 11:40:13 mysqld_safe Starting mysqld daemon with databases from /mnt/mysql 161220 11:40:13 InnoDB: The InnoDB memory heap is disabled 161220 11:40:13 InnoDB: Mutexes and rw_locks use GCC atomic builtins 161220 11:40:13 InnoDB: Compressed tables use zlib 1.2.3 161220 11:40:13 InnoDB: Initializing buffer pool, size = 16.0M 161220 11:40:13 InnoDB: Completed initialization of buffer pool 161220 11:40:13 InnoDB: Log file /mnt/mysql/ib_logfile0 did not exist: new to be created InnoDB: Setting log file /mnt/mysql/ib_logfile0 size to 5 MB InnoDB: Database physically writes the file full: wait... 161220 11:40:13 InnoDB: Log file /mnt/mysql/ib_logfile1 did not exist: new to be created InnoDB: Setting log file /mnt/mysql/ib_logfile1 size to 5 MB InnoDB: Database physically writes the file full: wait... 161220 11:40:13 InnoDB: Cannot initialize created log files because 161220 11:40:13 InnoDB: data files are corrupt, or new data files were 161220 11:40:13 InnoDB: created when the database was started previous 161220 11:40:13 InnoDB: time but the database was not shut down 161220 11:40:13 InnoDB: normally after that. 161220 11:40:13 [ERROR] Plugin 'InnoDB' init function returned error. 161220 11:40:13 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 161220 11:40:13 [ERROR] Unknown/unsupported storage engine: InnoDB 161220 11:40:13 [ERROR] Aborting 161220 11:40:13 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete 161220 11:40:13 mysqld_safe mysqld from pid file /mnt/mysql/li539-254.pid ended 161220 11:43:41 mysqld_safe Starting mysqld daemon with databases from /mnt/mysql 161220 11:43:41 InnoDB: The InnoDB memory heap is disabled 161220 11:43:41 InnoDB: Mutexes and rw_locks use GCC atomic builtins 161220 11:43:41 InnoDB: Compressed tables use zlib 1.2.3 161220 11:43:41 InnoDB: Initializing buffer pool, size = 16.0M 161220 11:43:41 InnoDB: Completed initialization of buffer pool 161220 11:43:41 InnoDB: highest supported file format is Barracuda. InnoDB: No valid checkpoint found. InnoDB: If this error appears when you are creating an InnoDB database, InnoDB: the problem may be that during an earlier attempt you managed InnoDB: to create the InnoDB data files, but log file creation failed. InnoDB: If that is the case, please refer to InnoDB: http://dev.mysql.com/doc/refman/5.5/en/error-creating-innodb.html 161220 11:43:41 [ERROR] Plugin 'InnoDB' init function returned error. 161220 11:43:41 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 161220 11:43:41 [ERROR] Unknown/unsupported storage engine: InnoDB 161220 11:43:41 [ERROR] Aborting
最后在my.cnf把这几个设大了,竟然就启动了~~
innodb_additional_mem_pool_size = 20M
innodb_log_file_size = 50M
innodb_log_buffer_size = 80M
2019年10月11日另外台服务器再次出现mysql死掉,无法启动的问题
Error!: SQLSTATE[HY000] [2002] No such file or directory
查看日志文件
191011 21:44:08 mysqld_safe Starting mysqld daemon with databases from /www/mysql/data 191011 21:44:08 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.5.48-log) starting as process 10168 ... 191011 21:44:08 [Note] Plugin 'FEDERATED' is disabled. 191011 21:44:08 InnoDB: The InnoDB memory heap is disabled 191011 21:44:08 InnoDB: Mutexes and rw_locks use GCC atomic builtins 191011 21:44:08 InnoDB: Compressed tables use zlib 1.2.3 191011 21:44:08 InnoDB: Initializing buffer pool, size = 2.0G InnoDB: mmap(2197815296 bytes) failed; errno 12 191011 21:44:08 InnoDB: Completed initialization of buffer pool 191011 21:44:08 InnoDB: Fatal error: cannot allocate memory for the buffer pool 191011 21:44:08 [ERROR] Plugin 'InnoDB' init function returned error. 191011 21:44:08 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 191011 21:44:08 [ERROR] Unknown/unsupported storage engine: InnoDB 191011 21:44:08 [ERROR] Aborting 191011 21:44:08 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete 191011 21:44:08 mysqld_safe mysqld from pid file /www/mysql/data/localhost.localdomain.pid ended
按照上面的一顿操作改了my.cnf还是不行,搞的有点烦,就把ib_logfile0 ib_logfile1 都删除了,还是不行,日志一直是上面的错误提示。
用free -g 命令看,可用内存都是0,就把服务器重启了一下,nnd mysql照样启动不了,继续把日志的每句错误都百度了一下,搜出的文章内容都是大同小异,问题还没解决。
好在这个服务器上就一个网站还没啥流量,主要是用来爬虫抓数据的。搞的太烦了没洗澡就直接睡觉了~
第二天一早起来,想到把另外台正常服务器的my.cnf 替换过来看看,替换后mysql竟然正常启动了。 我把2个配置文件对比了下就2个区别
1、注释innodb_additional_mem_pool_size
#innodb_additional_mem_pool_size = 20M
2、innodb_buffer_pool_size 由 2G 改成 4G
在采集程序开启后没等30分钟,mysql又死了,
[root@service51 ~]# service mysql restart ERROR! MySQL server PID file could not be found! Starting MySQL.... ERROR! The server quit without updating PID file (/www/mysql/data/service51.pid).
这次改到如下后,又能正常启动
1、注释2项
#server-id = 1
#expire_logs_days = 10
2、innodb_log_buffer_size 由8M改成80M
3、删掉ib_logfile0 ib_logfile1 两个文件
总结:
这个问题是第二次出现了,其实还是没真正找到这个问题的根本原因。二次问题都是用InnoDB结构 然后数据存在ibdata1上,这次ibdata1已经272G了,上次出现这个问题好像ibdata1也2、300G大小。