1. 程式人生 > >Can't connect to local MySQL server through socket '/var/lib/mysql'

Can't connect to local MySQL server through socket '/var/lib/mysql'

在配置 sphinx報這個錯

ERROR: index 'test1': sql_connect: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) (DSN=mysql://root:***@localhost:3306/test).

解決辦法

看哈 mysql是否正常執行

得知配置檔案my.conf中mysql.sock 路徑不同造成的

可以將路徑mysql.sock移動到var/lib/mysql/mysql.sock

重啟服務即可