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

前端 未结 9 628
孤城傲影
孤城傲影 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: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

提交回复
热议问题