By default, mysql compilation and installation may fail to connect to mysqserver after installation, and the following error occurs: ldquo; ERROR2002 (HY000): Can
By default, mysql compilation and installation may fail to connect to mysq server after installation, and the following ERROR occurs: ldquo; ERROR 2002 (HY000): Can
By default, mysql compilation and installation may fail to connect to mysq server after installation, and an error is reported.
"ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql. sock' (2 )"
This will cause 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"
You can also specify the -- socket option (-S is the same) when starting mysql ):
$ Mysql -- socket =/path/to/mysql. sock
Easy to use ~~