yum install mysql 显示 mysql 安装完成,无法启动解决

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 仍然提示上述错误,原因还需进一步分析。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容