linux - MySQL failing to start under Cent OS
天蓬老师
天蓬老师 2017-04-17 11:57:29
[MySQL讨论组]

阿里云 centos下,mysqld进程进场无缘无故的关闭。

关闭后,无法重启

service mysqld start

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

log信息是这样的:

150306 07:06:32 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
150306  7:06:32 [Note] libgovernor.so not found
150306  7:06:32 [Note] Plugin 'FEDERATED' is disabled.
150306  7:06:32 InnoDB: The InnoDB memory heap is disabled
150306  7:06:32 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150306  7:06:32 InnoDB: Compressed tables use zlib 1.2.3
150306  7:06:32 InnoDB: Using Linux native AIO
150306  7:06:32 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
150306  7:06:32 InnoDB: Completed initialization of buffer pool
150306  7:06:32 InnoDB: Fatal error: cannot allocate memory for the buffer pool
150306  7:06:32 [ERROR] Plugin 'InnoDB' init function returned error.
150306  7:06:32 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
150306  7:06:32 [ERROR] Unknown/unsupported storage engine: InnoDB
150306  7:06:32 [ERROR] Aborting

150306  7:06:32 [Note] /usr/libexec/mysqld: Shutdown complete

150306 07:06:32 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

my.cnf配置信息是这样的:

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

# Settings user and group are ignored when systemd is used (fedora >= 15).
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mysqld according to the
# instructions in http://fedoraproject.org/wiki/Systemd
user=mysql

# Semisynchronous Replication
# http://dev.mysql.com/doc/refman/5.5/en/replication-semisync.html
# uncomment next line on MASTER
;plugin-load=rpl_semi_sync_master=semisync_master.so
# uncomment next line on SLAVE
;plugin-load=rpl_semi_sync_slave=semisync_slave.so

# Others options for Semisynchronous Replication
;rpl_semi_sync_master_enabled=1
;rpl_semi_sync_master_timeout=10
;rpl_semi_sync_slave_enabled=1

# http://dev.mysql.com/doc/refman/5.5/en/performance-schema.html
;performance_schema


[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

求帮助!


已解决。
mysql无故关闭是应为:php-fpm占用内存太多。(先free查看内存,发现很小。 然后sudo ps aux发现有好多php-fpm进程,占用了好多内存。)
解决办法:修改配置文件

vim /etc/php-fpm.conf

pm.max_children = 10
pm.start_servers = 2
pm.min_spare_servers = 2
pm.max_spare_servers = 10

pm.max_requests = 1
天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

全部回复(1)
迷茫
150306  7:06:32 InnoDB: Initializing buffer pool, size = 128.0M

size过大,改小一点就可以了,参考地址: http://blog.chinaunix.net/uid-16844903-id-3081529.html

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号