Upgraded MySQL and now Getting Error: #1251 ?

August 27th, 2005

Since I returned to Windows from Linux I have had a few problems with PHP MySQL the hardest one I’ve found was the following:

#1251 – Client does not support authentication protocol requested by server; consider upgrading MySQL client

To explain this problem as simple as possible: The new MySQL version has a different password authenticating version (or something to that effect) that php struggles to communicate with; the way to get over that is is relatively simple; you simply tell mysql to use the old password system.

Here is a simple example you may wish to use to get over your teething problems:
Load the MySQL commandline client (from your start menu),
or:

Start > Run > cmd [enter]
c:\>mysql -u root -p %root_password%

Once inside the client, create and modify the user accounts that you will be using through php thusly:
The user I’ll be creating will be: phpusr with a password of: 3ncry9t3d

mysql> use mysql
Database changed
mysql> grant all on *.* to ‘phpusr’@’localhost’ identified by ‘3ncry9t3d’;
Query OK, 0 rows affected (0.00 sec)

mysql> set password for ‘phpusr’@’localhost’= old_password(‘3ncry9t3d’);
Query OK, 0 rows affected (0.00 sec)

Try it out and leave a comment if it doesn’t work or is wrong.


5 Comments to “Upgraded MySQL and now Getting Error: #1251 ?”


  1. alex said:

    this entry changed my life.


  2. a-v0id said:

    sarcastic cow!


  3. v0id said:

    …did you upgrade php when you upgraded mysql


  4. alex said:

    moooooooooooooooooooooooooooo.
    *rolls big cow eyes*


  5. a-v0id said:

    v0id: Yes, it was a fresh install of Apache PHP4 and MySQL
    Apache/1.3.33 (Win32), PHP/4.4.0 and MySQL/4.1.13a

Leave a Reply