There are 5 solutions as follows, I generally use the first one to solve the problem, and the other online searches are organized as follows for reference
1. Kill the existing mysql process
ps -ef | grep mysqld kill -9 xxx
2. Insufficient mysql file permissions
chown -R mysql:mysql /mnt/mysql chmod -R 755 /mnt/mysql /etc/init.d/mysqld restart
3. When mysql is installed for the second time, there is residual data that affects the service startup
Delete the mysql-bin.index file in the /mysql_data directory
4. View the configuration file my.cnf
[root@tzPC mysql]# cat /etc/ my.cnf [mysqld] user = mysql basedir =/mnt/ mysql datadir =/mnt/ mysql_data #Check if there is this line socket =/tmp/ mysql.sock server_id = 6 port = 3306 [mysql] socket =/tmp/mysql.sock
5. Turn off selinux
[root@tzPC mysql]# cat /etc/selinux/config # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled # SELINUXTYPE= can take one of three two values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted
Read More:
- [Solved] MySQL Startup Error: The server quit without updating PID file
- [Solved] Starting MySQL… ERROR The server quit without updating PID file
- MAC MYSQL Start Error: The server quit without updating PID
- [Solved] MYSQL Error: ERROR! MySQL server PID file could not be found!
- Mysql Flashback Warning: C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql.exe
- [Solved] ERROR 2002 (HY000): Can’t connect to local MySQL server through socket’/var/lib/mysql/mysql.sock’ (2)
- ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’
- MYSQL 5.7 Error Code: 1290. The MySQL server is running with the –secure-file-priv option so it..
- [Solved] MYSQL Command Execute Error: Can ‘t connect to local MySQL server through socket ‘/tmp/mysql.sock ‘(2) “
- How to Solve can‘t connect to local mysql server through socket ‘/var/lib/mysql/mysql.sock‘
- MySql Install Error: Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘
- MYSQL Enter password:ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘localhost:3306‘
- How to Solve MYSQL Error: Failed to start MySQL 8.0 database server
- MYSQL Insert Data Error: check the manual that corresponds to your MySQL server version for the right syntax
- ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’
- (Fixed) workbench MySQL Error Code: 2013. Lost connection to MySQL server during query
- How to Fix MySQL ERROR 1130 (HY000): Host ‘XXXX’ is not allowed to connect to this MySQL server
- [Solved] CentOS installs MySQL and starts MySQL with error 2002 (HY000)
- Remote connection to MySQL database error: is not allowed to connect to this MYSQL server solution
- Centos7 Initialize mysql Error: Could not open file ‘/usr/local/mysql/log/mysqld.log‘ for error logging: Per