我使用 mysql57-community-release-el6-7.noarch.rpm Repo 在 RHEL 6.5 上安装了 Mysql 服务器 5.7.9。安装成功,但是当我尝试启动它时出现错误。从 /var/log/mysqld.log 我得到这些日志
> 2016-02-16T08:16:55.473839Z 0 [Note] InnoDB: PUNCH HOLE support
> available 2016-02-16T08:16:55.473945Z 0 [Note] InnoDB: Mutexes and
> rw_locks use GCC atomic builtins 2016-02-16T08:16:55.473983Z 0 [Note]
> InnoDB: Uses event mutexes 2016-02-16T08:16:55.474011Z 0 [Note]
> InnoDB: GCC builtin __sync_synchronize() is used for memory barrier
> 2016-02-16T08:16:55.474038Z 0 [Note] InnoDB: Compressed tables use
> zlib 1.2.3 2016-02-16T08:16:55.474062Z 0 [Note] InnoDB: Using Linux
> native AIO 2016-02-16T08:16:55.474908Z 0 [Note] InnoDB: Number of
> pools: 1 2016-02-16T08:16:55.475257Z 0 [Note] InnoDB: Not using CPU
> crc32 instructions mysqld: Can't create/write to file '/tmp/ibUFqzVe'
> (Errcode: 13 - Permission denied) 2016-02-16T08:16:55.475430Z 0
> [ERROR] InnoDB: Unable to create temporary file; errno: 13
> 2016-02-16T08:16:55.475460Z 0 [ERROR] InnoDB: Plugin initialization
> aborted with error Generic error 2016-02-16T08:16:55.475490Z 0 [ERROR]
> Plugin 'InnoDB' init function returned error.
> 2016-02-16T08:16:55.475515Z 0 [ERROR] Plugin 'InnoDB' registration as
> a STORAGE ENGINE failed. 2016-02-16T08:16:55.475536Z 0 [ERROR] Failed
> to initialize plugins. 2016-02-16T08:16:55.475557Z 0 [ERROR] Aborting
>
> 2016-02-16T08:16:55.475583Z 0 [Note] Binlog end
> 2016-02-16T08:16:55.475695Z 0 [Note] Shutting down plugin
> 'keyring_file' 2016-02-16T08:16:55.476442Z 0 [Note] /usr/sbin/mysqld:
> Shutdown complete
>
> 2016-02-16T08:16:55.502968Z mysqld_safe mysqld from pid file
> /var/run/mysqld/mysqld.pid ended
任何建议这个错误正在谈论什么......
答案1
MySQL 服务器无法访问您的 /tmp 目录、写入和创建临时文件。确保 /tmp 目录由 root 用户拥有,并且在 /tmp 目录上设置了粘滞位。键入以下命令来修复此错误。您必须以 root 用户身份登录并输入:
chown root:root /tmp
chmod 1777 /tmp
测试一下
/etc/init.d/mysqld 启动
答案2
> [ERROR] InnoDB: Unable to create temporary file; errno: 13
这条线看起来有问题。尝试检查/tmp
dir 是否存在(应该存在)并且可供 mysql 用户(或您使用的用户)使用。您可以尝试使用不同的路径--tmpdir
或配置中的选项,更多信息在文档中)。
SELinux 也可能存在问题(如果它处于强制模式)。ausearch -ts today -m avc | audit2allow
如果 /tmp dir 没有被 mysql 阻止,请检查您的审核日志(例如,使用)。对于测试,您可以使用 禁用 SELinux setenforce 0
。