Centos - 无法启动 MySQL

Centos - Can't start MySQL

我安装了 ioncube 加载器,现在我无法启动我的 SQL 服务器。

错误:

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

这是我的日志

150507 20:01:03 mysqld_safe Starting mysqld daemon with databases from     /var/lib/mysql
150507 20:01:03  InnoDB: Initializing buffer pool, size = 8.0M
150507 20:01:03  InnoDB: Completed initialization of buffer pool
150507 20:01:03  InnoDB: Operating system error number 13 in a file     operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.
150507 20:01:03 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid          ended    

这是我尝试设置新烫发时显示的内容

[root@server ~]# sudo chown -R mysql:mysql /var/lib/mysql
chown: changing ownership of `/var/lib/mysql/notes': Operation not permitted
chown: changing ownership of `/var/lib/mysql/ib_logfile0': Operation not permitted
chown: changing ownership of `/var/lib/mysql/samp': Operation not permitted
chown: changing ownership of `/var/lib/mysql/ibdata1': Operation not permitted
chown: changing ownership of `/var/lib/mysql/mysql': Operation not permitted
chown: changing ownership of `/var/lib/mysql/shoutcast': Operation not permitted
chown: changing ownership of `/var/lib/mysql/ogp_panel': Operation not permitted
chown: changing ownership of `/var/lib/mysql/ogpbre': Operation not permitted
chown: changing ownership of `/var/lib/mysql/ib_logfile1': Operation not     permitted

快速解决方案可以是:

sudo chmod 755 -R /var/lib/mysql/

看起来你的 /var/lib/mysql/ 有一个 i 标志。 运行 按照命令 chattr -i -R /var/lib/mysql 然后尝试 chown -R mysql:mysql /var/lib/mysql