( ! ) Warning: mysql_connect() [function.mysql-connect]: 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 in C:\wamp\www\PHPExcel\Tests\phpexcelreader2beta.php on line 33
Call Stack
# Time Memory Function Location
1 0.0009 397632 {main}( ) ..\phpexcelreader2beta.php:0
2 19.8845 66398448 mysql_connect ( ) ..\phpexcelreader2beta.php:33
Could not connectmysqlnd 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

Has anyone else experienced this problem. I read a couple of forums and one guy had this to say about the error....

The above problem occures because of version in-compatibility between PHP and MySql. Mostly it may occurs during remote access of db.

Kindly check your PHP and Mysql versions.

My versions are PHP-5.3.6(Local machine) and Mysql 5.1.56(Live DB).

My Mysql is placed in live domain and I kept my php files in local machine. I faced the same password rest problem.

Then I replace my XAMPP with older version it changed my PHP version to 5.3.0. Now the above problem was solved and able to access the live db from local.

Re: Question: Premature end of data (mysqlnd_wireprotocol.c:553)

Posted 18 September 2012 - 11:47 AM

Ok here is the deal! I didn't change my password...all I did was download Wamp PHP 5.2.2. After it installed I started Wamp, left clicked on Wamp in my icon tray, selected PHP->Version...and clicked on 5.2.2. Now the errors went away! After doing research I have come to the conclusion that this error occurs because of version in-compatibility between PHP and MySql. I hope this helps all that are paddling up the same creek!! HERE'S A PADDLE!!

Re: Question: Premature end of data (mysqlnd_wireprotocol.c:553)

Posted 18 September 2012 - 01:08 PM

O no. That is a horrible fix. I say that for two reasons.

First, the reason PHP 5.3 is incompatible with your MySQL server is because the server is, apparently, using the old, insecure authentication system which was replaced in MySQL 4.1 with a new, improved system. The mysqlnd client API (which was added to PHP in 5.3 to remove the reliance on the MySQL C API) does not support that, long deprecated, old authentication schema. - The proper fix for this, then, is to upgrade the authentication schema, not to downgrade PHP. All MySQL versions above 4.1 are capable of this. It just requires one simple command, which was even provided in the error message!

And second. PHP 5.2 is old. Aside from all the new features in 5.3 and 5.4, the 5.2 branch is no longer supported. That means no more updates. No more security fixes. Downgrading to that to avoid a critical, and long overdue, security upgrade should not be considered a viable option.

By the way, why 5.2.2? That's ancient, even for a 5.2 release. Over 5 years old... The 5.2 brach ended in 5.2.17, according to the docs.