5.,7下,mysqld_safe启动实例报错
[root@test2 ~]# 2018-09-08T01:42:11.940420Z mysqld_safe Logging to '/var/log/mysqld/my57_3307.log'.
2018-09-08T01:42:11.949380Z mysqld_safe Directory '/var/run/mysqld' for UNIX socket file don't exists.
[1]+ Exit 1 /usr/local/mysql57/bin/mysqld_safe --defaults-file=/dbdata/mysql/my57_3307/my57_3307.cnf --ledir=/usr/local/mysql57/bin
解决办法:
[root@test2 ~]# vim /usr/local/mysql57/bin/mysqld_safe
# Check that directory for $safe_mysql_unix_port exists
mysql_unix_port_dir=`dirname $safe_mysql_unix_port`
if [ ! -d $mysql_unix_port_dir ]
then
mkdir $mysql_unix_port_dir
chown $user $mysql_unix_port_dir
chmod 755 $mysql_unix_port_dir
# Changed 5.7 setttings:
# log_error "Directory '$mysql_unix_port_dir' for UNIX socket file don't exists."
# exit 1
fi
5.7的mysqld_safe启动检查目录时,没有直接报错退出.改成5.6的建目录即可.