Using a Unix socket to connect to MySQL

In some circumstances you may want to use a Unix socket to connect to the database: for example, if networking is disabled in MySQL.

To do this, use a setting like this in your config.php:


define('DATABASE_HOST', 'unix_socket:/var/run/mysqld/mysqld.sock');


making sure the second parameter is unix_socket:  then the correct path to the socket.

Helpful Unhelpful

5 of 17 people found this page helpful

Add a comment

You need to log in before you can submit a comment.

Need a password reminder?