Mysql cannot be found in Linux. solution to the sock file: by default, mysql compilation and installation may fail to connect to the mysq server after installation. The ERROR "ERROR 2002 (HY000 ): can't connect to local MySQL server through socket '/var/run/mysql. sock '(2) "is a headache for cainiao. After some exploration by cainiao, I finally found a solution. Mysql. the sock file is in the/tmp directory by default, but you can use/etc/my. cnf file (about how this file comes from, you will naturally know it when compiling and installing mysql) to change its location, as long as you specify the socket variable: "socket =/var/run/mysql. sock "www.2cto.com or specify the -- socket option (-S) when starting mysql: $ mysql -- socket =/path/to/mysql. sock is simple ~~ Reference: http://dev.mysql.com/doc/refman/5.1/zh/problems.html#error-access-deniedhttp://dev.mysql.com/doc/refman/5.1/zh/problems.html#problems-with-mysql-sock author gh0st007