mysql报错Do you already have another mysqld server running on socket
背景:启动mysql失败报错如下显示
# /etc/init.d/mysqld start Starting MySQL...... ERROR! The server quit without updating PID file (/mysql/data/DB-1.pid).
查看日志发现了如下两条:
2018-01-13 16:57:13 19796 [ERROR] Do you already have another mysqld server running on socket: /application/mysql-5.6.36/tmp/mysql.sock ? 2018-01-13 16:57:13 19796 [ERROR] Aborting
发现问题出在/application/mysql-5.6.36/tmp/mysql.sock
检查/etc/my.cnf下mysql配置文件确认sock文件在/appkication/mysql/tmp下
[mysqld] user=mysql port=3306 socket=/application/mysql-5.6.36/tmp/mysql.sock basedir=/application/mysql datadir=/mysql/data server-id=3306 general_log=off log-error=/mysql/error.log log-bin=/mysql/log/bin-log binlog-format=ROW
检查该路径发现tmp路径属于root
将该路径分配给mysql用户重启mysql,问题解决
# chown -R mysql.mysql tmp/ # /etc/init.d/mysqld start Starting MySQL....... SUCCESS!