I am getting PDO::__construct(): OK packet 6 bytes shorter than expected in latest PHP 5.3.1, any idea or fixes?
Asked
Active
Viewed 1,920 times
2 Answers
3
If you are using the new mysqlnd driver (which is often the case with PHP 5.3, as it's one of the new stuff introduced with 5.3), you cannot connect to a MySQL database using the old-passwords system.
See, for instance :
- Resolving the "OK packet 6 bytes shorter than expected"
- MySQL PHP incompatibility.
- Backward Incompatible Changes
Not sure it's what is causing the problem in your case, but that's one common MySQL related thing, with PHP 5.3...

Community
- 1
- 1

Pascal MARTIN
- 395,085
- 80
- 655
- 663
-
yes this worked SET PASSWORD FOR 'username'@'hostmask' = PASSWORD('thepassword') – user217631 Dec 08 '09 at 06:02
-
Great news ;-) ;; And nice to see more and more questions about PHP 5.3 ! Have fun ! – Pascal MARTIN Dec 08 '09 at 06:12
0
I'm assuming you're using MySQL since this error usually occurs with in. This indicates some sort of incompatibility between PHP and MySQL. Without knowing the exact situation (version numbers, upgrades done, etc.) it's hard to diagnose.
I really shouldn't say this, but in many cases downgrading to PHP 5.2.x will fix the problem instantly.

Dumb Guy
- 3,336
- 21
- 23