CenOS7启动Mysql服务时报Failed to start mysql.service Unit not found.

linux版本:CenOS7

执行完yum安装命令后发现竟然无法启动错误提示如下

[root@localhost ~]# systemctl start mysql.service

Failed to start mysql.service: Unit mysql.service not found.

查了半天资料,终于了解到CenOS7中MariaDB代替了mysql数据库

所以以前的systemctl start mysql.service在CenOS7中相当于systemctl start mariadb.service

因此用上述命令启动不起来,正确的方法如下:

# yum install mariadb -y //如果已安装可以省略

# systemctl start mariadb.service //启动服务

# systemctl enable mariadb.service //开机启动服务

# mysql -u root -p //登录mysql

发布了88 篇原创文章 · 获赞 3 · 访问量 4220

猜你喜欢

转载自blog.csdn.net/weixin_43691098/article/details/103908601