重启MySQL报错:
[root@ycyzharry ~]# service mysqld restart Redirecting to /bin/systemctl restart mysqld.service Failed to restart mysqld.service: Unit not found.
使用chkconfig --list查询服务列表:
[root@ycyzharry ~]# chkconfig --list Note: This output shows SysV services only and does not include native systemd services. SysV configuration data might be overridden by native systemd configuration. If you want to list systemd services use 'systemctl list-unit-files'. To see services enabled on particular target use 'systemctl list-dependencies [target]'. mysqld-3306 0:off 1:off 2:on 3:on 4:on 5:on 6:off netconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:off network 0:off 1:off 2:on 3:on 4:on 5:on 6:off zabbix_agentd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
可以看到服务名称为"mysql-3306",按如下命令重启:
[root@ycyzharry ~]# service mysqld-3306 restart Stopping ... Mysql stopped Starting Mysql server...