Mysql prompt mysql daemon failed to start Solution

Source: Internet
Author: User

I am using a linux system, but the mysql database on the website cannot be connected. I want to restart it. After the restart, mysql prompts mysql daemon failed to start, I will search for some solutions below. If you need them, please refer to them.

In cli mode, run service myqsld start to find the error message "mysql deamon failed to start.

 
#/Etc/init. d/mysqld start

 

MySQL Daemon failed to start.

 

Starting mysqld: [FAILED]

 

View the log file of mysqld

 

# Less/var/log/mysqld. log

 

/Usr/libexec/mysqld: Can't change dir to 'xxx' (Errcode: 13)

 

First, view database logs.

 

Mysqld started

 

[Warning] Can't create test file xxx. lower-test


[Warning] Can't create test file xxx. lower-test
 

/Usr/libexec/mysqld: Can't change dir to '/XXX' (Errcode: 13)

 

[ERROR] Aborting

 

First, check the permissions and users of the data directory and log directory. The permissions and users are correct. It should be the SELINUX permission restriction.

 

First, view the current configuration information.

 
 

# Getenforce

 
Enforcing


SELinux is enabled. You only need to disable SELinux.


Close method:


# Setenforce 0 (0 | 1 on | off)

 

Or


Setsebool ftpd_disable_trans 1

Command.

Of course, the above method is not the best solution. We can just grant permissions.

According to the log situation, the specific analysis and processing is generally

Mysql database permissions: chmod 777-r/var/lib/mysql;

Note: Database User: chown-R mysql: mysql/var/lib/mysql

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.