在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
2、systemctl daemon-reload
重新加载某个服务的配置文件,如果新安装了一个服务,归属于 systemctl 管理,要是新服务的服务程序配置文件生效,需重新加载。
3、systemctl restart mysqld.service
现在已经成功,可以验证在 my.cnf 中更改的配置是否生效。
如果需要设置mysql服务开机自启,输入 systemctl enable mysqld.service
发表评论