error message: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) Cause of the problem: It is possible that the [mysqld] parameter socket is set in the my.cnf configuration file, but the [client] parameter socket is not set. What is the mysql.sock file used for: mysql supports both socket and TCP/IP connections. So what is the use of the mysql.sock file? Connections to localhost are usually made through a Unix domain socket file, typically /tmp/mysql.sock. If the socket file is deleted, local clients will not be able to connect. The /tmp folder is a temporary file and may be deleted at any time. 1. TCP connection (if an error message is displayed for /tmp/mysql.sock, you can try this method to connect)
2.Socket connection
Solution: Add the [client] configuration item as shown below Before configuration: (Before configuring [client], an error message will be reported: '/tmp/mysql.sock' (2))
After configuration: (After configuring [client], restart the mysql service)
end, this article ends, I hope it will be helpful to everyone! You may also be interested in:
|
<<: Tutorial on deploying multiple servers with WebApi and configuring Nginx load balancing
>>: Vue uses WebSocket to simulate the chat function
The process packets with the SYN flag in the RFC7...
After installing VMware Tools, ① text can be copi...
Structural (position) pseudo-class selector (CSS3...
Table of contents DML statements 1. Insert record...
This article shares the specific code for JavaScr...
If you don't have a Linux system, please refe...
Based on past experience, taking notes after comp...
This article shares the specific code of react to...
There are currently three ways to display the cen...
Table of contents 1. Add users 2. Change the user...
The decompressed version of MYSQL is installed 1:...
question In LINUX, periodic tasks are usually han...
The Raspberry Pi model is 4b, 1G RAM. The system ...
1. Configuration By default, the first two are no...
Create an HTML page with an unordered list of at l...