Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the hueman domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/CloudIngenium.com/htdocs/wp-includes/functions.php on line 6114
How to: Have WordPress communicate with MySQL via Socket – Knowledge eXchange

How to: Have WordPress communicate with MySQL via Socket

How to: Have WordPress communicate with MySQL via Socket

As I keep looking into how to improve the performance of website one of the recurrent points mentioned is to use Linux sockets where possible. I really don’t have much experience and I can see how avoiding the TCP stack might help but I figured at least it couldn’t hurt. If you are able to establish a socket connection to MySQL you might also be in the camp of those interested in having WordPress connect to MySQL via a Linux socket connection vs using an IP Address. I searched but it seems there are not that many people doing this, so I thought I would share it so you can also give it a try to your site if you want.

The standard way to connect to a host is:

servername:/route/to/mysql.sock

by default this might look like this for many people:

localhost:/var/run/mysqld/mysqld.sock

so your wp-config.php file would look like this:

/** MySQL hostname */
define(‘DB_HOST’, ‘localhost:/var/run/mysqld/mysqld.sock’);

You may also like...

1 Response

  1. Jono says:

    I know this is from 2014. But really, thank you!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.