1

Strangely, this worked fine for a while, but my computer rebooted recently and now my php apps won't work:

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 [2000]

I saw the solution was to turn off old_passwords in the mysql config... except it wasn't turned on in my my.cfg (the option wasn't present at all and adding it changed nothing) nor will it change in the console:.

> SET SESSION old_passwords=FALSE; 
ERROR 1231 (42000): Variable 'old_passwords' can't be set to the value of '0'

I tried looking at the password hash:

> select password('test'); 
+------------------+ 
| password('test') | 
+------------------+ 
| 378b243e220ca493 | 
+------------------+  

And it is short. There's nothing I can find on the net as to why it does that, the mariadb docs say it is supposed to be 41 characters long, but it just isn't and it is breaking all the php 5.4 stuff.

I'm out of ideas short of just saying forget it and reinstalling an old php or something. Anyone else seen this? Ideally, I'd like the passwords to use the new hash format so php just works.

2
  • Are you saying that you reset the password as shown, and you tried to set msql to use the new password hash (both in config and command line) the password is still not the new hash? Could you share what version of mysql you are running? If you are running a version which can handle larger passwords, you should check the section in here on upgrading the password field size and verify that the password column is large enough in your table. dev.mysql.com/doc/refman/5.7/en/mysql-upgrade.html
    – ssl
    Jan 20, 2015 at 21:07
  • Yeah, changing the old_passwords setting failed and the hash is still the short one, even without going through the table. show create table mysql.user shows the password field as being char(41), which is the correct size, but the password() hashing function returns a shorter, old-style hash. select version() gives 5.5.32-MariaDB and mysql --help says mysql Ver 15.1 Distrib 5.5.32-MariaDB, for Linux (x86_64) using readline 5.1. BTW --help does NOT list the old_password variable at all. Jan 20, 2015 at 22:43

0

You must log in to answer this question.

Browse other questions tagged .