ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'
Java services, logstash call mysql are all fine. But using mysql, mysqldump command will report the above error.
Solution: add socket=/var/lib/mysql/mysql.sock under the mysql configuration file client, the path is the same as under mysqld
Reason: mysql and mysqldump are clients, and the socket configured in mysqld on the server must also be configured in the client