Home  >  Article  >  Database  >  莫名其妙的MySQL错误Can't create secure /var/tmp/mysql

莫名其妙的MySQL错误Can't create secure /var/tmp/mysql

WBOY
WBOYOriginal
2016-06-07 15:40:321103browse

莫名其妙的不能启动MySQL,service mysql start总是报错: # service mysql restart Restarting service MySQL Shutting down service MySQL done Can't create secure /var/tmp/mysql.rbOr3b failed 最后六个字符貌一个随机串。 Baidu之,啥都木有,Google

莫名其妙的不能启动MySQL,service mysql start总是报错:

# service mysql restart
Restarting service MySQL
Shutting down service MySQL                                           done
Can't create secure /var/tmp/mysql.rbOr3b                       failed

最后六个字符貌似一个随机串。

Baidu之,啥都木有,Google之,也是SUSE家的openSUSE论坛上有人求助,我的是高大的SLES。

看了半天,没人回答,反而几个人纠结在文法和表达形式上,鬼子就是闲得蛋疼。


只好自己琢磨/etc/init.d/mysql,找到出错的地方,瞄一眼就发现有问题。

然后命令行`id mysql`,竟然出来个这:

# id mysql
uid=60(mysql) gid=107(ntp) groups=107(ntp)

mysql啥时候和ntp勾搭在一起了,打开/etc/group一看果然,

#grep 107 /etc/group
/etc/group:mysql:!:107:
/etc/group:ntp:!:107:

再用看看MySQL和NTPrpm安装包里的script,

#rpm -q --scripts mysql ntp | grep group
/usr/sbin/groupadd -r mysql >/dev/null 2>/dev/null || :
/usr/sbin/groupadd -r ntp 2> /dev/null || :

非常标准普通的group添加方式,没有hardcode呀,估计跟RP有关了,不过应该是IT部门的RP莫名其妙的MySQL错误Can't create secure /var/tmp/mysql

幸亏申请了Root权限,立马调整/etc/group,把mysql的gid换个新113,更新/etc/passwd里mysql的gid一并更新。

# service mysql restart
Restarting service MySQL
Shutting down service MySQL                         done
Starting service MySQL                                  done

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn