Bug #52440 [Opn]: Add note for mysql/mysqli/pdo_mysql when using mysqlnd

From: Date: Thu, 26 Aug 2010 08:21:11 +0000
Subject: Bug #52440 [Opn]: Add note for mysql/mysqli/pdo_mysql when using mysqlnd
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-4933@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=52440&edit=1 ID: 52440 Updated by: uw@php.net Reported by: anthon dot pang at gmail dot com Summary: Add note for mysql/mysqli/pdo_mysql when using mysqlnd Status: Open Type: Bug Package: Documentation problem Operating System: n/a PHP Version: 5.3.3 Block user comment: N New Comment: As explained by Johannes in the other bug report http://bugs.php.net/52434 the hostname "localhost" has a special meaning for MySQL. Ever since "localhost" stands for "create a socket connection". The intend of "mysql:host=localhost;port=3307;dbname=testdb" is not "clearly to connect via TCP". That's simply wrong. "host=localhost" sets the rule "if you are on Unix, use a Unix domain socket to connect to MySQL". No bug here. The proposed Note must not be added to the documentation. What could be improved is the connection string example. As this bug report makes clear it has confused at least one user. This is something the docs folks can have a look at. The doc team may decide, for example, to link to some place which explains the special meaning of "localhost". Previous Comments: ------------------------------------------------------------------------ [2010-07-25 20:47:17] anthon dot pang at gmail dot com Description: ------------ Since the one-line patch in #52434 was rejected, please add a 'Note' to document the following backwards incompatibility. First, the "more complete example" shown on this page http://www.php.net/manual/en/ref.pdo-mysql.connection.php : mysql:host=localhost;port=3307;dbname=testdb requires that a unix socket be configured in php.ini (even though the intent is clearly to connect via tcp) if php is built '--with-pdo-mysql=mysqlnd'. (This is a compat buster because the same DSN and php.ini works when php is instead linked against the mysql client libraries.) Second, this incompatibility also occurs when php is built '--with-mysqli=mysqlnd' (and presumably '--with-mysql=mysqlnd'). Thus, please add similar Notes to: http://www.php.net/manual/en/mysqli.connect.php http://ca2.php.net/mysqli_real_connect http://ca.php.net/mysql_connect Third, add comments to php.ini-development and php.ini-production files to clearly state that these *must* be configured when php is built with mysqlnd: pdo_mysql.default_socket = mysql.default_socket = mysqli.default_socket = (Though the configure script looks for and finds /var/run/mysqld/mysqld.sock, this information isn't used by mysqlnd.) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=52440&edit=1

« previous php.doc.bugs (#4933) next »