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
1. First find mysql Directory where the sock is located
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!!
- 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’
- How to Solve can‘t connect to local mysql server through socket ‘/var/lib/mysql/mysql.sock‘
- mac brew install mysql ‘/tmp/mysql.sock’ (2) [How to Solve]
- MySql Warning: The server quit without updating PID file error
- Ubuntu ERROR 2003 (HY000): Can’t connect to MySQL server on ‘127.0.0.1’ (111)
- Hive install initialization error: Error: Duplicate key name ‘PCS_STATS_IDX‘ (state=42000,code=1061)
- host ‘‘ is not allowed to connect to this mysql server Connect MYSQL Error
- [Solved] CentOS installs MySQL and starts MySQL with error 2002 (HY000)
- MYSQL8 Startup Error: mysqld_safe error: log-error set to ‘/var/log/mariadb/mariadb.log‘
- Python calls the MySQLdb library, and an error “Library not loaded: libmysqlclient.18.dylib” is reported
- [Solved] mariadb Startup Error: Job for mariadb.service failed because the control process exited with error code.
- Mysql Flashback Warning: C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql.exe
- [Solved] Error: ER_HOST_NOT_PRIVILEGED: Host ‘x.x.x.x‘ is not allowed to connect to this MySQL server
- Docker mysql8 modify password
- MySQL character set error resolution: err=Error 3988: Conversion from collation utf8mb4_unicode_ci into utf8_general_ci impo
- [Solved] SQLSTATE[HY000]  Connection refused to report an error when PHP connects to mysql in the docker container
- MYSQL 5.7 Error Code: 1290. The MySQL server is running with the –secure-file-priv option so it..
- Using Mybatis to connect to the database error: Loading class `com.mysql.jdbc.Driver‘. This is deprecated. The new driver···