expandedfronts / revisr

Revisr: Git for WordPress
https://revisr.io
GNU General Public License v3.0
195 stars 41 forks source link

Connect to MySQL via unix socket #48

Closed danielmerriott closed 9 years ago

danielmerriott commented 9 years ago

I have a setup with local mysql with all network access to mysql disabled (skip-networking is enabled in the mysql configuration). As such the mysql server is defined in wp-config.php to use a unix socket:

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

The configuration line above is based on the official WordPress Codex.

Would it be possible to detect this scenario and have Revisr attempt to connect to mysql via the unix socket (i.e. without specifying a host/port) please?

mattgrshaw commented 9 years ago

Hi,

This should be fixed with the latest release (1.9.4). I tested with a socket on MAMP and confirmed it's working for backups. Please test and thanks for reporting the issue!

danielmerriott commented 9 years ago

Thanks Matt. I'll wait for 1.9.4 to be available via the WordPress plugin and will test then. I also found a workaround - when using sockets with mysql 5.6 simply using 'localhost' as the dbname works just fine too - no need to specify the path to the socket. Not sure if this is true with previous versions of mysql or other setups as I don't have access to test.