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
[[email protected] 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
[[email protected] 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:
- ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’
- ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’
- [Solved] CentOS installs MySQL and starts MySQL with error 2002 (HY000)
- [Solved] ERROR 2002 (HY000): Can’t connect to local MySQL server through socket’/var/lib/mysql/mysql.sock’ (2)
- MYSQL8 Startup Error: mysqld_safe error: log-error set to ‘/var/log/mariadb/mariadb.log‘
- How to Solve can‘t connect to local mysql server through socket ‘/var/lib/mysql/mysql.sock‘
- [Solved] MYSQL Command Execute Error: Can ‘t connect to local MySQL server through socket ‘/tmp/mysql.sock ‘(2) “
- [Solved] Mysql Build Error: [ERROR] Slave I/O for channel ‘‘: error connecting to master
- mac brew install mysql ‘/tmp/mysql.sock’ (2) [How to Solve]
- MySQL character set error resolution: err=Error 3988: Conversion from collation utf8mb4_unicode_ci into utf8_general_ci impo
- [Solved] mariadb Startup Error: Job for mariadb.service failed because the control process exited with error code.
- How to Solve MYSQL Error: Failed to start MySQL 8.0 database server
- Solve MySQL table can not query, modify, delete and other operations and appear stuck
- How to Solve mysqld — console command error
- After installing mysql5.7 on centos7, an error 1045 (28000) is reported: access denied for user ‘root’ @’localhost ‘(using PAS)
- MySql Install Error: Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘
- How to Solve Mysql8 load data error
- [Solved] ERROR: child process failed, exited with error number 14 (error number 1, error number 100)
- MYSQL 5.7 Error Code: 1290. The MySQL server is running with the –secure-file-priv option so it..
- Centos7 Initialize mysql Error: Could not open file ‘/usr/local/mysql/log/mysqld.log‘ for error logging: Per