Failed to restart mysqld.service: Unit not found.


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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM