阿毛
It's me !
想你所想

Failed to restart mysqld.service: Unit not found

在my.cnf修改了部分mysql的配置,为了配置生效需要重启mysql,输入 systemctl restart mysql.service时,报错“ Failed to restart mysqld.service: Unit not found ”

前提:CentOS7,并已安装了mysql。

要解决报错信息, 需要安装mysql-server 。
1、 yum install -y mysql-server

https://file.blog.humh.cn/2020/04/image-6-1024x238.png

2、systemctl daemon-reload
重新加载某个服务的配置文件,如果新安装了一个服务,归属于 systemctl 管理,要是新服务的服务程序配置文件生效,需重新加载。
3、systemctl restart mysqld.service
现在已经成功,可以验证在 my.cnf 中更改的配置是否生效。

如果需要设置mysql服务开机自启,输入 systemctl enable mysqld.service

# #
首页      code      MySQL      Failed to restart mysqld.service: Unit not found

humh

文章作者

站长本人,一个憨批!

发表回复

textsms
account_circle
email

想你所想

Failed to restart mysqld.service: Unit not found
在my.cnf修改了部分mysql的配置,为了配置生效需要重启mysql,输入 systemctl restart mysql.service时,报错“ Failed to restart mysqld.service: Unit not found ” 前提:CentOS7,…
扫描二维码继续阅读
2020-04-05