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