@anonymous-piwik-user opened this issue on February 26th 2009

I want to use a unix-domain socket that was different than the output of mysql_config --socket on the machine where PHP was installed.

localhost;unix_socket=/home/myusername/mysql/socket

Install proceeds otherwise uneventfully, and then bombs out when I first visit it with a complaint:

SQLSTATE[[2002](HY000]) Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
@robocoder commented on February 26th 2009

Thank you for your interest in Piwik. However, we can't provide this level of MySQL support. Please try the MySQL forums.

@anonymous-piwik-user commented on February 26th 2009

If I edit the config/config.ini.php and put double-quotation marks around the host line:

host = "localhost;unix_socket=/home/myusername/mysql/socket"

then Piwik can connect to the MySQL server. However, when Piwik rewrites the configuration file it quickly reverts back to:

host = localhost;unix_socket=/home/myusername/mysql/socket

which is parsed as:

host = localhost

Line 128 of core/Config.php indicates you've already dealt with this problem for another key. Please encapsulate any field with an embedded ; character. My proof-of-concept looks like this:

if (strpos($value, ';') !== false) {
    $value = '"'.$value.'"';
} else

although I'd recommend that Piwik actually escape values and handle strings of any type.

@robocoder commented on February 26th 2009

Rolled requirements into #481 (username should be in quotes).

@anonymous-piwik-user commented on February 26th 2009

thanks

@robocoder commented on March 19th 2009

see also #614

This issue was closed on August 18th 2009
Powered by GitHub Issue Mirror