PHP 5.4 PDO could not connect to MySQL 4.1+ using the old insecure authentication

后端 未结 3 1186
遥遥无期
遥遥无期 2020-12-01 07:05

I know there are a tonne of similar questions, in fact I\'ve read all (9) of them.

However, none of them solve my problem.

I have a shared-hosting package (t

相关标签:
3条回答
  • 2020-12-01 07:34

    In phpMyAdmin, setting the session variable will work, but the call to the password function must occur in the same session/execution.

    For example, if I execute:

    SET SESSION old_passwords = 0;
    SET PASSWORD = PASSWORD('notagoodpassword');
    

    It will correctly set it.

    0 讨论(0)
  • 2020-12-01 07:45

    SOLVED!

    Although the SET SESSION old_passwords=0; wasn't working in phpMyAdmin.

    I downloaded the MySQL GUI Tools and used the MySQL Query Browser to execute the same command on non-DBO user:

    SET SESSION old_passwords = 0;

    SELECT @@global.old_passwords, @@session.old_passwords, Length(PASSWORD('abc'));

    now returned:

    1      0      41
    

    So I simply changed the password:

    SET PASSWORD = PASSWORD('my_old_password')

    And now PHP 5.4 PDO connects to the database with that user!

    0 讨论(0)
  • 2020-12-01 07:46

    this solution worked: SET SESSION old_passwords = 0;

    BUT: I had to drop the "old" userfrosting table afterwards and create it new - then it worked like a charm.

    0 讨论(0)
提交回复
热议问题