我正在安装全新的 CentOS 6.5 并试图让 MySQL 5.6 服务器守护程序运行。该服务器是 DigitalOcean 基础设施上的一个新小滴。512 MB 大小。我使用了MySQL Yum 存储库中的 MySQL 版本。当我尝试启动它时,它神秘地崩溃了,没有任何迹象表明出了什么问题。以下是一些细节:
首先,我的 /etc/my.cnf:
[mysqld]
innodb_buffer_pool_size = 5M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
explicit_defaults_for_timestamp = TRUE
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
当我跑步时service mysqld start
,我得到了这个:
[root@myserver ~]# service mysqld start
MySQL Daemon failed to start.
Starting mysqld: [FAILED]
这是/var/log/mysqld.log
输入该命令后的完整内容:
140104 22:53:41 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2014-01-04 22:53:42 8177 [Note] Plugin 'FEDERATED' is disabled.
2014-01-04 22:53:42 8177 [Note] InnoDB: The InnoDB memory heap is disabled
2014-01-04 22:53:42 8177 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-01-04 22:53:42 8177 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-01-04 22:53:42 8177 [Note] InnoDB: Using Linux native AIO
2014-01-04 22:53:42 8177 [Note] InnoDB: Not using CPU crc32 instructions
2014-01-04 22:53:42 8177 [Note] InnoDB: Initializing buffer pool, size = 5.0M
2014-01-04 22:53:42 8177 [Note] InnoDB: Completed initialization of buffer pool
2014-01-04 22:53:42 8177 [Note] InnoDB: Highest supported file format is Barracuda.
140104 22:53:43 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
没有错误,没有警告,什么都没有。当我跑步时service mysqld status
,它会说mysqld dead but subsys locked
。
有任何想法吗?
更新:我进入 /etc/init.d/mysqld 并添加了一行以将其使用的确切启动命令回显到控制台。然后我运行该命令(但没有将任何输出重定向到 /dev/null 或后台处理进程)。这是出现的情况:
[root@myserver ~]# /usr/bin/mysqld_safe --datadir="/var/lib/mysql" --socket="/var/lib/mysql/mysql.sock" --pid-file="/var/run/mysqld/mysqld.pid" --basedir=/usr --user=mysql
140105 08:04:35 mysqld_safe Logging to '/var/log/mysqld.log'.
140105 08:04:35 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
/usr/bin/mysqld_safe: line 166: 10966 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 >> /var/log/mysqld.log 2>&1
140105 08:04:36 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
看起来某个外部服务或看门狗在尝试启动 MySQL 时正在杀死它。但这是怎么回事?似乎没有安装 SELinux。不知道还有什么...?