重啟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...