Mysql 【systemctl start mysql】启动失败:未找到该命令

2022-10-25 08:27:35

Mysql 【systemctl start mysql】启动失败:未找到该命令记录

原因: /etc/init.d/ 不存在 mysqld 这个命令

1·、首先你需要找到 mysql.server 文件,这个 和 mysqld 文件是一模一样的,只不过文件名不相同

 命令:  find  /  -name mysql.server

2、copy mysql.server 文件到 /etc/init.d/ 目录下,重命名文件为 mysqld

 命令:cp  /phpstudy/mysql/support-files/mysql.server  /etc/init.d/mysqld

再 service mysqld status ,这个问题就解决了。

==============================================

接着重新启动,又遇到 【Unit mysqld.service could not be found】。

首先需要安装mariadb-server

1、命令: yum install -y mariadb-server
启动服务

2、命令: systemctl start mariadb.service
添加到开机启动

3、命令: systemctl enable mariadb.service

  • 作者:7Rizen
  • 原文链接:https://blog.csdn.net/weixin_42277824/article/details/115690703
    更新时间:2022-10-25 08:27:35