Opened 5 years ago

Closed 5 years ago

#614 closed Bug (fixed)

MySQL: unix socket support

Reported by: vipsoft Owned by:
Priority: normal Milestone: RobotRock
Component: Core Keywords:
Cc: Sensitive:

Description

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 (host[0] == '/') {
   dsn = "unix_socket=$host";
} else {
   dsn = "host=$host;port=$port";
}

Change History (1)

comment:1 Changed 5 years ago by vipsoft (robocoder)

  • Resolution set to fixed
  • Status changed from new to closed

(In [991]) Fix #614 - MySQL unix socket support

Note: See TracTickets for help on using tickets.