Description
Today, when adding a MySQL slave node to the online production environment, the following error was reported when executing the command to back up MySQL data:
Can 't connect to local MySQL server through socket '/tmp/mysql.sock '(2) "
The general meaning of error reporting is that MySQL under TMP cannot be found Sock file
Solution:
1. First find mysql Directory where the sock is located
find/-name mysql.sock
2. Create/TMP/MySQL Sock soft connect to the file
establish a soft connection (write an absolute path):
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
If the manual residual soft connection is wrong, you can delete it with the following command:
rm -rf /tmp/mysql.sock
Re-execute MySQL command, perfect solution!!
Read More:
- MySql Install Error: Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘
- How to Solve can‘t connect to local mysql server through socket ‘/var/lib/mysql/mysql.sock‘
- ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’
- [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 ‘/var/run/mysqld/mysqld.sock’
- MYSQL Enter password:ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘localhost:3306‘
- mac brew install mysql ‘/tmp/mysql.sock’ (2) [How to Solve]
- Mysql Flashback Warning: C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql.exe
- host ‘‘ is not allowed to connect to this mysql server Connect MYSQL Error
- Remote connection to MySQL database error: is not allowed to connect to this MYSQL server solution
- How to Fix MySQL ERROR 1130 (HY000): Host ‘XXXX’ is not allowed to connect to this MySQL server
- MySQL Install Error: MySQL error 1042: Unable to connect to any of the specified MySQL hosts
- (Fixed) workbench MySQL Error Code: 2013. Lost connection to MySQL server during query
- MYSQL 5.7 Error Code: 1290. The MySQL server is running with the –secure-file-priv option so it..
- [Solved] MYSQL Error: ERROR! MySQL server PID file could not be found!
- MYSQL Insert Data Error: check the manual that corresponds to your MySQL server version for the right syntax
- [Solved] mysqldump Command Error: Got error: 2002: “Can‘t connect to server on ‘127.0.0.1‘ (36)“ when trying to connect
- How to Solve MYSQL Error: Failed to start MySQL 8.0 database server
- Ubuntu ERROR 2003 (HY000): Can’t connect to MySQL server on ‘127.0.0.1’ (111)
- [Solved] MySQL Error: Can‘t find record in ‘order_form‘