Search code examples
phpmysqlsocketsshared

Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'. This is not supported on the shared server.How to solve this?


This is not supported on the shared hosting server, Any idea?

Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server
through socket '/var/lib/mysql/mysql.sock' (2)

Solution

  • I have checked further and i am using Mysql.Socket - this is not supported on the shared server. The connection should be Mysqli. When i have changed the mysql into mysqli now it is perfectly connecting.