|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-09-08 18:34 UTC] uw@php.net
-Status: Open
+Status: Feedback
[2010-09-08 18:34 UTC] uw@php.net
[2010-09-08 19:23 UTC] php at diptyque dot net
[2010-09-08 19:41 UTC] uw@php.net
-Status: Feedback
+Status: Bogus
[2010-09-08 19:41 UTC] uw@php.net
[2010-09-10 16:15 UTC] php at diptyque dot net
[2013-11-30 18:55 UTC] luisvillalta7 at gmail dot com
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 11:00:01 2025 UTC |
Description: ------------ Some PHP legacy code no longer works with the 5.3.3 MYSQLND-enabled [1] PDO MySQL driver -- I got 2 warnings and an exception is raised: [07-Sep-2010 14:31:16] PHP Warning: PDO::__construct(): Premature end of data (mysqlnd_wireprotocol.c:554) in /my/path/to/php/auto/append.php on line xx [07-Sep-2010 14:31:16] PHP Warning: PDO::__construct(): OK packet 1 bytes shorter than expected in /my/path/to/php/auto/append.php on line xx Exception says that "mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication." This is inconsistent with the behavior of the 5.3.3 MySQL extension built with MYSQLND support: I have even older PHP code that can connect to MySQL 4.1+ using the old insecure authentication scheme (!?) Go figure. Of course, reverting to the PDO MySQL driver w/ classic MySQL client library support works. [1] mysqlnd 5.0.7-dev - 091210 - $Revision: 300533 $ Test script: --------------- <?php try { $dbh = new PDO($sql->dsn, $sql->username, $sql->password); $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (Exception $e) { /* ... */ } // failure ?> vs. <?php $dbh = mysql_pconnect( $mysql['hostname'], $mysql['username'], $mysql['password'] ); // success ?> Expected result: ---------------- Why does old password authentication still works with MYSQLND-enabled MySQL extension but not with MYSQLND-enabled PDO MySQL driver? Actual result: -------------- SQLSTATE[HY000] [2000] mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file