mysqli_real_connect() – authentication method unknown to the client Warnings

I keep getting the following warnings in my debug log:

PHP Warning:     mysqli_real_connect(): The server requested authentication method unknown to the client [mysql_old_password] in /wp-includes/wp-db.php on line 1379
PHP Warning:     mysqli_real_connect(): (HY000/2054): The server requested authentication method unknown to the client in /wp-includes/wp-db.php on line 1379
PHP Deprecated:  mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /wp-includes/wp-db.php on line 1409

Over and over again, I’m running the following setup:

PHP       - 5.5.6
MYSQL     - 5.5.38
WordPress - 4.0.1

All my plugins are up to date and there’s not many that I haven’t used before and this problem only seems to occur on this host so I’ve ruled out plugins. I’ve looked up this problem but I don’t understand what any of the answers are actually saying:

MYSQL PHP Incompatibility

Need help sorting out mysql permisions and connections

It sounds like that some user has entered a password too long to be hashed? And if that’s the case, how would I go about handling that, resetting everybodies password? Could somebody maybe explain in layman terms what exactly the problem is?

1 Answer
1

This doesn’t have anything to do with WordPress or your user’s passwords.

What it means is that your MySQL server is still using the old-password-hash mechanism, which was changed in MySQL 4.1. The PHP mysqli client is newer and doesn’t support the old password mechanism. Since this causes an error, WordPress falls back to the old mysql client, which does support this but is deprecated (that’s the third error message you see).

In other words, the “password” it is referring to here is not the WordPress password, it’s the password you use to connect WordPress to your database. That username and password in the wp-config.php file, basically.

What you need to do is to change the password for the database itself to the new-hash-version. This is a bit arcane, and if you don’t actually control the MySQL server, you may not have access to do that.

You could ask your host to disable old_passwords, but if it’s a shared database system, they’re likely to be unwilling to do so.

If you do control your server, look into this answer. Note that he got the answer backwards, explaining how to enable old_passwords. You want to do the same basic process, but the other way around, to disable old_passwords and get the longer hash mechanism instead of the shorter one.

https://dba.stackexchange.com/questions/33447/connect-error-2054-mysql-old-password-issue-still-not-solved

Leave a Comment