The socket cannot be connected because the socket file of mysql is read abnormally.
[root@k3 bin]# ./mysqldump -uroot -p socket=/opt/zbox/tmp/mysql/mysql.sock --database zentao > ./zentao.sql
Warning: Using unique option prefix database instead of databases is deprecated and will be removed in a future release. Please use the full name instead.
Enter password:
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) when trying to connect
Find the correct socket file to connect to mysql, and execute the mysqdump command again