centos mysql 自动关闭_centos 6 下 mysql 5.6 总是自动停止,重启mysqld 后一会又会自动停止,无线循环,求助呀!...

在CentOS 6.3环境中,安装的MySQL 5.6服务经常自动关闭,间隔时间为10到30分钟。错误日志显示因内存不足导致InnoDB初始化失败。尝试重新安装MySQL并未解决问题。通过分析日志,发现是由于内存分配失败(errno 12)导致MySQL无法启动。目前的解决办法是在启动前重启Apache服务,然后MySQL才能正常启动。
摘要由CSDN通过智能技术生成

1.配置环境

阿里云服务器

centos 6.3

Apache 2.2.4

mysql 5.6

php 5.3.3

主要运行的程序为 WordPress

2.问题描述:

mysql 可以启动正常,一切看起来都很正常,网站可以访问,数据库用PHPmyadmin也能访问;但是过一小段时间(10~30分钟不等)就自己停止掉;SSH 命令行中显示如下

# /usr/bin/mysqld_safe: line 183:  9161 Killed                  nohup /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sock < /dev/null > /dev/null 2>&1

然后直接启动是不行的会报错如下:

# service mysqld restart

Stopping mysqld:                                           [  OK  ]

MySQL Daemon failed to start.

Starting mysqld:                                           [FAILED]

但是先重启下httpd,紧接着在启动mysqld 就能够正常起来;

# service mysqld restart

Stopping mysqld:                                           [  OK  ]

MySQL Daemon failed to start.

Starting mysqld:                                           [FAILED]

[root@localhost ~]# service httpd restart

Stopping httpd:                                            [  OK  ]

Starting httpd:                                            [  OK  ]

[root@localhost ~]# service mysqld restart

Stopping mysqld:                                           [  OK  ]

Starting mysqld:                                           [  OK  ]

Mysqld.log 如下;

2017-09-05 23:03:34 10926 [Note] InnoDB: Using atomics to ref count buffer pool pages

2017-09-05 23:03:34 10926 [Note] InnoDB: The InnoDB memory heap is disabled

2017-09-05 23:03:34 10926 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2017-09-05 23:03:34 10926 [Note] InnoDB: Memory barrier is not used

2017-09-05 23:03:34 10926 [Note] InnoDB: Compressed tables use zlib 1.2.3

2017-09-05 23:03:34 10926 [Note] InnoDB: Using Linux native AIO

2017-09-05 23:03:34 10926 [Note] InnoDB: Using CPU crc32 instructions

2017-09-05 23:03:34 10926 [Note] InnoDB: Initializing buffer pool, size = 128.0M

InnoDB: mmap(137363456 bytes) failed; errno 12

2017-09-05 23:03:34 10926 [ERROR] InnoDB: Cannot allocate memory for the buffer pool

2017-09-05 23:03:34 10926 [ERROR] Plugin 'InnoDB' init function returned error.

2017-09-05 23:03:34 10926 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

2017-09-05 23:03:34 10926 [ERROR] Unknown/unsupported storage engine: InnoDB

2017-09-05 23:03:34 10926 [ERROR] Aborting

2017-09-05 23:03:34 10926 [Note] Binlog end

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'partition'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'FEDERATED'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'INNODB_SYS_TABLES'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'INNODB_FT_CONFIG'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'INNODB_FT_DELETED'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'INNODB_METRICS'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'INNODB_CMPMEM'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'INNODB_CMP_RESET'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'INNODB_CMP'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'INNODB_LOCKS'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'INNODB_TRX'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'ARCHIVE'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'BLACKHOLE'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'CSV'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'MEMORY'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'MRG_MYISAM'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'MyISAM'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'sha256_password'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'mysql_old_password'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'mysql_native_password'

2017-09-05 23:03:34 10926 [Note] Shutting down plugin 'binlog'

2017-09-05 23:03:34 10926 [Note] /usr/sbin/mysqld: Shutdown complete

2017-09-05 23:11:21 11670 [Note] InnoDB: Using atomics to ref count buffer pool pages

2017-09-05 23:11:21 11670 [Note] InnoDB: The InnoDB memory heap is disabled

2017-09-05 23:11:21 11670 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2017-09-05 23:11:21 11670 [Note] InnoDB: Memory barrier is not used

2017-09-05 23:11:21 11670 [Note] InnoDB: Compressed tables use zlib 1.2.3

2017-09-05 23:11:21 11670 [Note] InnoDB: Using Linux native AIO

2017-09-05 23:11:21 11670 [Note] InnoDB: Using CPU crc32 instructions

2017-09-05 23:11:21 11670 [Note] InnoDB: Initializing buffer pool, size = 128.0M

2017-09-05 23:11:21 11670 [Note] InnoDB: Completed initialization of buffer pool

2017-09-05 23:11:21 11670 [Note] InnoDB: Highest supported file format is Barracuda.

2017-09-05 23:11:21 11670 [Note] InnoDB: The log sequence numbers 0 and 0 in ibdata files do not match the log sequence number 1600617 in the ib_logfiles!

2017-09-05 23:11:21 11670 [Note] InnoDB: Database was not shutdown normally!

2017-09-05 23:11:21 11670 [Note] InnoDB: Starting crash recovery.

2017-09-05 23:11:21 11670 [Note] InnoDB: Reading tablespace information from the .ibd files...

2017-09-05 23:11:21 11670 [Note] InnoDB: Restoring possible half-written data pages

2017-09-05 23:11:21 11670 [Note] InnoDB: from the doublewrite buffer...

2017-09-05 23:11:21 11670 [Note] InnoDB: 128 rollback segment(s) are active.

2017-09-05 23:11:21 11670 [Note] InnoDB: Waiting for purge to start

2017-09-05 23:11:21 11670 [Note] InnoDB: 5.6.37 started; log sequence number 1600617

2017-09-05 23:11:21 11670 [Note] Server hostname (bind-address): '*'; port: 3306

2017-09-05 23:11:21 11670 [Note] IPv6 is available.

2017-09-05 23:11:21 11670 [Note]   - '::' resolves to '::';

2017-09-05 23:11:21 11670 [Note] Server socket created on IP: '::'.

2017-09-05 23:11:21 11670 [Note] Event Scheduler: Loaded 0 events

2017-09-05 23:11:21 11670 [Note] /usr/sbin/mysqld: ready for connections.

Version: '5.6.37'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server (GPL)

3.尝试过的办法有:

卸载并重装mysql 5.6,问题依旧存在;

百度google搜了很久都没办法解决;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值