MySQL Startup failure resolution

Source: Internet
Author: User
Tags create directory percona server

Today, when you start MySQL, use/etc/init.d/mysqld start error

Starting MySQL (Percona Server). mkdir: Cannot create directory '/var/lib/mysql': File existschown: Cannot access '/ Var/lib/mysql': Permission deniedchmod: Cannot access '/var/lib/mysql': Permission deniedRM: Cannot remove '/var/lib/mysql/mysql.sock': Permission denied  file (/var/run/mysqld/mysqld.pid).

This is a permissions issue, but viewing the Discovery directory permission is already right

To view the startup script, call the/usr/bin/mysqld_safe startup process when it starts, two are shell scripts, use debug mode to execute

Found to be invalidated when the catalog is judged

In fact, this directory is present, to view the log that failed to start

is also a permissions issue, but the directory permissions are correct, so the possible problem arises when you start the Mysql_safe script that causes some problems

The switch starts in the following way

Sh

Discovery started successfully, this situation is equivalent to start directly with the root user, review the correlation, found that the SELinux organization of MySQL access to the corresponding directory permissions,

Because here we do not use the SELinux directly shut down, the way to temporarily switch off as follows:

0

Permanently turn off the need to modify the /etc/selinux/config and restart the machine.

Selinux=disabled

You can also open permissions for the relevant directory

[Shell#]chcon-r-T mysqld_db_t  dir

No error if you start again

MySQL Startup failure resolution

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.