Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unix domain sockets don't work #570

Closed
anonymous-matomo-user opened this issue Feb 26, 2009 · 5 comments
Closed

Unix domain sockets don't work #570

anonymous-matomo-user opened this issue Feb 26, 2009 · 5 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc. duplicate For issues that already existed in our issue tracker and were reported previously. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.

Comments

@anonymous-matomo-user
Copy link

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
Copy link
Contributor

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

@anonymous-matomo-user
Copy link
Author

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
Copy link
Contributor

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

@anonymous-matomo-user
Copy link
Author

thanks

@robocoder
Copy link
Contributor

see also #614

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. duplicate For issues that already existed in our issue tracker and were reported previously. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Projects
None yet
Development

No branches or pull requests

2 participants