本篇文章主要介绍了"centos 7 yum install mysql 安装mariadb 后 mysql 无法启动的解决方法",主要涉及到方面的内容,对于MySql感兴趣的同学可以参考一下:
yum install mysql 显示 mysql 安装完成,但service mysql status, service mysql start 均提示失败...
yum install mysql 显示 mysql 安装完成,但service mysql status, service mysql start 均提示失败,数据库也无法登陆。
[root@ansible flask_sqlalchemy]# service mysql status
Redirecting to /bin/systemctl status mysql.service
● mysql.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
[root@ansible flask_sqlalchemy]# service mysql start
Redirecting to /bin/systemctl start mysql.service
Failed to start mysql.service: Unit mysql.service failed to load: No such file or directory.
[root@ansible flask_sqlalchemy]# mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
解决方法:
# yum install mariadb-server -y
#
systemctl start mariadb.service
#
systemctl enable mariadb.service
#
mysql
参考:http://www.centoscn.com/CentosBug/softbug/2016/0115/6660.html
数据库可以登陆,但是service mysql 仍然提示上述错误,原因还需进一步分析。
以上就介绍了centos 7 yum install mysql 安装mariadb 后 mysql 无法启动的解决方法,包括了方面的内容,希望对MySql有兴趣的朋友有所帮助。
本文网址链接:http://www.codes51.com/article/detail_433533.html