Mysql cannot be started after mariadb is installed in CentOS

Source: Internet
Author: User
Yuminstallmysql indicates that mysql installation is complete, but servicemysqlstatus and servicemysqlstart both indicate failure and the database cannot be logged in. [Root @ ansibleflask_sqlalchemy] # servicemysqlstatusRedirectingto/bin/systemctlstatusm

Yum install mysql indicates that mysql installation is complete, but service mysql status and service mysql start indicate failure, and the database cannot be logged in.

[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. sock' (2)

Solution:

# Yum install mariadb-server-y

# Systemctl start mariadb. service

# Systemctl enable mariadb. service

# Mysql

Reference: http://www.centoscn.com/CentosBug/softbug/2016/0115/6660.html

You can log on to the database, but service mysql still prompts the above error. further analysis is required.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.