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

MySQL: unix socket support #614

Closed
robocoder opened this issue Mar 18, 2009 · 1 comment
Closed

MySQL: unix socket support #614

robocoder opened this issue Mar 18, 2009 · 1 comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@robocoder
Copy link
Contributor

Piwik support for unix sockets is kludgey. The unix socket is configured (embedded in) the host setting:

```
host = “localhost;unix_socket=/path”
```

This results in a DSN that looks like “host=localhost;unix_socket=/path;port=3306”.

For now, this appears to work, but according to PHP docs (http://www.php.net/manual/en/ref.pdo-mysql.connection.php), unix_socket “shouldn’t be used with host or port” in the PDO DSN. (The implication is that while this works now, this may not be the case in the future.)

In core/Tracker/Db.php, I propose: (I omit the drivername and dbname to simplify the pseudocode)

```
if (host0 == ‘/’) {
dsn = “unix_socket=$host”;
} else {
dsn = “host=$host;port=$port”;
}
```

@robocoder
Copy link
Contributor Author

(In 991) Fix #614 – MySQL unix socket support

@robocoder robocoder added this to the RobotRock milestone Jul 8, 2014
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.
Projects
None yet
Development

No branches or pull requests

1 participant