Authentication with old password no longer supported, use 4.1 style passwords

前端 未结 9 618
孤城傲影
孤城傲影 2020-11-29 06:06

I have my website with hostgator and I want to access mysql database with C# windows application but when I tried to connect got this message:

\"Auth

相关标签:
9条回答
  • 2020-11-29 06:23

    I met this problem today, but I'v fixed it as below:

    SET old_passwords=FALSE;
    SET PASSWORD = PASSWORD('new pwd here');
    

    Well, maybe the server's connection version is lower than the client, so you have to run this:"SET old_passwords=FALSE;" Good Luck!

    0 讨论(0)
  • 2020-11-29 06:27

    Forget about applying SET old_password=0 since if the server is configured to use new password there is no reason to change the flag on the server if your app does not access anymore. Investigate the connector NET that you are using.

    Connector 6.5.4 is the right one to use old_password, rencent version are using the new one.

    The best practice would be to avoid to install the connector on the machine, just leave the NET to handle the dll if you already have it or anyway try to find MySQL.Data.DLL version 6.5.4.0 (384 kbytes)

    0 讨论(0)
  • 2020-11-29 06:34

    I just solved my problem just like this:

    1) Connect to the db with mysql workbench (select the "use old auth" and "send pass in cleartext"

    2) Using the workbench, I ran the following several times (because it kept saying '0 rows affected'): (also change userID and password to your proper stuff)

    SET SESSION old_passwords=0; 
    SET PASSWORD FOR userID=PASSWORD('password');
    
    SET SESSION old_passwords=false; 
    SET PASSWORD FOR userID=PASSWORD('password');
    

    3) Now go back to your app and it should run...

    That is how I did it at least. I am using IX mysql and they do use old auth on their server so you must do something on your end...

    0 讨论(0)
  • 2020-11-29 06:37

    Had the same problem using MySqlClient package for C#. Let's break it down:

    We need the database to not use old style passwords, thus we perform

    SET old_passwords=0;

    NOTICE there is no "SESSION" keyword. This is what allowed only your first query to work, "SESSION" implies temporary and any session settings are lost after a session ends.

    Next we need to set the password of the user@host to the new password style

    SET PASSWORD FOR user@host = PASSWORD('password');

    This two should allow your MySqlClient

    0 讨论(0)
  • 2020-11-29 06:42

    I had the same problem. In my case just ran the command below connected on my database by the Workbench:

    SET SESSION old_passwords=0;
    SET PASSWORD FOR my_user=PASSWORD('my_password');
    

    After that I could connnect using MySql Connector 6.6.5 in the c# code with the common mysql connection string:

    "server=my_server_ip;user=my_user;database=my_db;port=3306;password=my_password;"
    
    0 讨论(0)
  • 2020-11-29 06:42

    I have not managed to solve the problem as the others who have responded, although I tried out everything that has been proposed. In the end it turned out that the server on which stood my DB is not updated phpMyAdmin since version 3.5.5, and is currently being used everywhere version 4.1.14 and it is a problem. The solution is to update your host phpMyAdmin or your own mySQL back to an earlier version in order to continue working on remote DB. You may need this knowledge in order to solve some doubts that have arisen. :)

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