解决Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)问题

在安装好mysql后但是发现缺少某些模块,从新安装当设置密码是提示Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

你搜索/tmp/mysql.sock ,发现没有,我们老大想了一下决定建一个 touch /tmp/mysql.sock  ,chmod 777 /tmp/mysql.sock  , hehe OK !