未知/不受支持的存储引擎:InnoDB [英] Unknown/unsupported storage engine: InnoDB

查看:196
本文介绍了未知/不受支持的存储引擎:InnoDB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在设置复制服务器,当我第一次尝试启动mysql服务时,它失败:

I'm setting up a replication server and when I try to start the mysql service for the first time, it fails:

[root@ravioli mysql]# service mysqld start
MySQL Daemon failed to start.
Starting mysqld:                                           [FAILED]
[root@ravioli mysql]# tail /var/log/mysqld.log 
151013 13:41:27 [ERROR] Plugin 'InnoDB' init function returned error.
151013 13:41:27 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
/usr/libexec/mysqld: File '/databases/mysql/mysql_slow_queries.log' not found (Errcode: 13)
151013 13:41:27 [ERROR] Could not use /databases/mysql/mysql_slow_queries.log for logging (error 13). Turning logging off for the whole duration of the MySQL server process. To turn it on again: fix the cause, shutdown the MySQL server and restart it.
151013 13:41:27 [ERROR] Unknown/unsupported storage engine: InnoDB
151013 13:41:27 [ERROR] Aborting

151013 13:41:27 [Note] /usr/libexec/mysqld: Shutdown complete

151013 13:41:27 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

我确认用户mysql看到并能够写入/databases/mysql/mysql_slow_queries.log.

I confirmed that user mysql sees and is able to write to /databases/mysql/mysql_slow_queries.log.

然后我检查了getenforce并将其设置为Enforcing.

Then I checked getenforce and see it is set to Enforcing.

如何配置MySQL以使其与SELinux完美配合?

How do I configure MySQL to play nicely with SELinux?

推荐答案

好吧,这实际上是默认情况下,SELinuxEnforcing,这可以防止在文件系统上意外写入.我只需要告诉SELinux MySQL可以写到非标准目录就可以了.智慧:

By default SELinux is Enforcing, which prevents unexpected writes on the filesystem. I just needed to tell SELinux that it's OK for MySQL to write to a non-standard directory. To wit:

[root@ravioli]# semanage fcontext -a -t mysqld_db_t "/databases/mysql(/.*)?"
-bash: semanage: command not found.

Derp.要安装semanage,请使用以下命令:

Derp. To install semanage, use this:

yum install policycoreutils-python

现在再次运行命令.这可能需要一些时间...

Now run the command again. This may take a few moments...

[root@ravioli]# semanage fcontext -a -t mysqld_db_t "/databases/mysql(/.*)?"

通过查看以下配置文件,检查是否为此新目录配置了SELinux:

Check to see that SELinux is configured for this new directory by looking at this config file:

[root@ravioli]#  grep -i mysql /etc/selinux/targeted/contexts/files/file_contexts.local

/databases/mysql(/.*)?    system_u:object_r:mysqld_db_t:s0

可以添加其他目录,例如,如果某处有专用的tmp目录.

Additional directories can be added, for instance if you have a dedicated tmp directory somewhere.

[root@ravioli]# semanage fcontext -a -t mysqld_db_t "/databases/mysql_tmp(/.*)?"

再次检查配置:

[root@ravioli]# grep -i mysql /etc/selinux/targeted/contexts/files/file_contexts.local

/databases/mysql(/.*)?    system_u:object_r:mysqld_db_t:s0
/databases/mysql_tmp(/.*)?    system_u:object_r:mysqld_db_t:s0

最后,使用restorecron

restorecon -R -v /www/databases/mysql/

在我的设置中

restorecon -R -v /www/databases/mysql_tmp/

现在的问题:

service mysqld start

恩.

Starting mysqld:         [  OK  ]

这篇关于未知/不受支持的存储引擎:InnoDB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆