Hosting Knowledge Base

Home » Knowledge Base » General Information » Troubleshooting » “Warning: mysql_connect(): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock” error appears on my website

Knowledge Base

“Warning: mysql_connect(): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock” error appears on my website

The error message “Warning: mysql_connect(): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock” appears because you are trying to connect to your database using incorrect MySQL database host/server.

Most content management systems and database connection scripts use “localhost” as MySQL database host/server. In our hosting environment, you will have to explicitly specify the database host as it is listed in your control panel. For more information on your MySQL database connection settings please click HERE.