1. 程式人生 > >CentOS7安裝MySQL報錯,解決Failed to start mysqld.service: Unit not found CentOS7安裝MySQL,解決Failed to start mysqld.service: Unit not found

CentOS7安裝MySQL報錯,解決Failed to start mysqld.service: Unit not found CentOS7安裝MySQL,解決Failed to start mysqld.service: Unit not found

當輸入命令

~]# systemctl start mysql.service

要啟動MySQL資料庫是卻是這樣的提示

Failed to start mysqld.service: Unit not found

解決方法如下:

  首先需要安裝mariadb-server

  ~]# yum install -y mariadb-server

  啟動服務

  ~]# systemctl start mariadb.service

  新增到開機啟動

  ~]# systemctl enable mariadb.service