When restarting mysql on the centos 7 system, an error is reported Failed to restart mysqld.service: Unit not found.

On the centos 7 system, when using the regular command: systemctl restart mysql or service mysqld restart to restart mysql, the following error will be reported:

Failed to start mysqld.service: Unit not found.

According to the error reported, I searched a circle on the Internet, but failed! ! !

solution

1. Execute the following command to view the path of mysql.server

find / -name mysql.server

The execution result is as follows:

The path description is as follows:

#mysql源码解压包
/usr/local/mysql-8.0.31/bld/support-files/mysql.server


#我在一台机器上装了两个mysql,端口号分别为:3306、3307

#端口号为3306的mysql
/usr/local/mysql/support-files/mysql.server

#端口号为3307的mysql
/usr/local/mysql3307/support-files/mysql.server

 2. Restart mysql with port number 3306

/usr/local/mysql/support-files/mysql.server restart

3. Start mysql with port number 3306

/usr/local/mysql/support-files/mysql.server start

4. Mysql with port number 3306 stops

/usr/local/mysql/support-files/mysql.server stop

Guess you like

Origin blog.csdn.net/weixin_47156401/article/details/132126080