mysqld_safe The file /usr/local/mysql/bin/mysqld does not exist or is not executable

时间:2025-03-01 16:03:40

安装mysql5.7完成之后,执行service  mysql start命令启动mysql,却报了如下错误:

[mysql@node113 ~]$ service mysql start

Starting MySQL.2018-01-11T07:59:43.669963Z mysqld_safe The file /usr/local/mysql/bin/mysqld

does not exist or is not executable. Please cd to the mysql installation

directory and restart this script from there as follows:

./bin/mysqld_safe&

See /doc/mysql/en/ for more information

 ERROR! The server quit without updating PID file (/usr/local/mysqldb/data/).

这是因为mysqld_safe默认的会从从/usr/local/mysql/bin目录中去寻找启动脚本mysqld,但是我安装mysql的目录是/usr/local/mysqldb/mysql,因此要想解决上边这个报错的问题,可以在/usr/local/mysql/bin/目录下创建一个安装目录/usr/local/mysqldb/mysql/bin/mysqld的软连接:

ln -s /usr/local/mysqldb/mysql/bin/mysqld   /usr/local/mysql/bin/mysqld 

创建完软连接之后,再次执行service  mysql start命令即可成功。