Everything was working fine until...

I started my project by installing a fresh version of D6.19. No problems. Then I upgraded to D7 the same day because Organic Groups and related modules need to have PHP5.3.5. That was great until I tried to upgrade my version of PHP.

Server Characteristics: MS 2008 Server R2, with Plesk Control panel, etc. (see my footer for more)

After trying to upgrade my PHP...several failed attempts, I found some success. I was able to fix all of the errors except for one. I had to delete my install of D7 and start over again with a fresh install to make sure I get things right.

Problem is, once I get to setp 4., "Set up database" and after entering the required db name, username, and password—I get an error that will not let me move any farther.

It says:

Warning: PDO::__construct(): Premature end of data (mysqlnd_wireprotocol.c:554) in DatabaseConnection->__construct() (line 300 of %Mysite%\includes\database\database.inc).
Warning: PDO::__construct(): OK packet 1 bytes shorter than expected in DatabaseConnection->__construct() (line 300 of %MySite%\includes\database\database.inc).
In order for Drupal to work, and to continue with the installation process, you must resolve all issues reported below. For more help with configuring your database server, see the installation handbook. If you are unsure what any of this means you should probably contact your hosting provider.

Failed to connect to your database server. The server reports the following message: 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.

Is the database server running?
Does the database exist, and have you entered the correct database name?
Have you entered the correct username and password?
Have you entered the correct database hostname?

Here is the extensions open in my php.ini file:

extension_dir = "C:\SWsoft\Plesk\Additional\PleskPHP5\ext"

[ExtensionList]
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_mbstring.dll
extension=php_gd2.dll
extension=php_gettext.dll
extension=php_curl.dll
extension=php_exif.dll
extension=php_xmlrpc.dll
extension=php_openssl.dll
extension=php_soap.dll
extension=php_pdo_mysql.dll
extension=php_pdo_sqlite.dll
extension=php_imap.dll
extension=php_tidy.dll

Any help that you can provide on how to fix this issue is much appreciated.

Comments

erok415’s picture

Status: Active » Fixed

I realized that Plesk does not like PHP5.3.5 and that was were my problems began. I have since removed PHP 5.3.5 and am now running on 5.2.13.
E.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

mikec.pt’s picture

Status: Closed (fixed) » Active

Sorrry to bring this up again, but I found the same problem with 8.x, I was testing it but It requires PHP 5.3 and so the mysql error comes up!

I'm testing with a remote server and I did tried the "SET PASSWORD = PASSWORD('mypass')." trough phpmyadmin but I'm stil stuck with the problem, and I've seen other related problems googling about php5.3 and this error.

My question is: Does Drupal 8.x really needs php 5.3? Or can I change it make it work with 5.2? Its only for testing anyway!

Thanks!

mdupont’s picture

Assigned: erok415 » Unassigned
Status: Active » Closed (works as designed)
Issue tags: -MySQL, -pdo, -drupal 7

AFAIK D8 actually needs PHP 5.3 since it uses features not present in older versions of PHP. Since you narrowed down the problem to Plesk it seems it's more of a Plesk issue than a Drupal one.

andy_read’s picture

I've just upgraded my Debian server from php 5.2 to 5.3 and hit this same problem.
Completely diff (but more intelligible) message on D6 sites, but same basic problem: couldn't connect to database.
(Also killed my WordPress sites - didn't upset me much, but customer complained :-)

Just for info, I needed to:
1. edit /etc/mysql/my.cnf and change "old_passwords = 1" to 0 (false) or just comment out the line with #
2. I restarted mysql and apache2
3. I also needed to reset the user password for each site, done using phpMyAdmin (which itself wasn't affected by the problem, fortunately).

I hope this helps the next victim of php5.3 upgrades :-)