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