旧密码验证不再被支持,使用4.1风格的密码 [英] Authentication with old password no longer supported, use 4.1 style passwords
问题描述
我有我的网站,HostGator的,我想访问与C#Windows应用程序的MySQL数据库,但是当我试图连接得到了这样的信息:
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:
旧密码认证不再被支持,使用4.1风格
密码
"Authentication with old password no longer supported, use 4.1 style password"
我曾尝试给出的解决方案:
I have tried given solution:
SET SESSION old_passwords=0;
SET PASSWORD FOR user@host=PASSWORD('your pw here');
第一次查询成功执行,但我当第二个查询执行拒绝访问用户@主机的错误。我不明白为什么会出现这个问题。我使用的MySQL连接器网6.6.5。
first query executed successfully but I got the error "Access denied for user@host" when second query executed. I can't understand why there is this problem. I am using MySQL-connecter-net 6.6.5.
我成功地使用MySQL工作台47年2月5日连接我的数据库。
I successfully connect my database with MySql workbench 5.2.47.
谁能帮我,我可以做更多?
Can anyone help me what I can do more?
我联系我的托管网站,并更改my.cnf文件使用4.1风格的密码。和我能够与MySQL连接
I have contact my hosting site and they make changes to my.cnf file to use 4.1 style password. and i am able to connect with mysql
mysql -u <username> -p <password> -h <hostname>;
但是当我试图用C#与MySQL连接器6.6.5网络连接,我再次得到这个错误。
but when i tried to connect with C# with mySQL connecter net 6.6.5 i again got this error.
我在Windows 8 64位使用Visual Studio 2012与MySQL连接器6.6.5。这是code I用于连接
I am using Visual Studio 2012 with MySQL connector 6.6.5 on Windows 8 64 bit. this is the code i used to connect
using MySQL.Data.MySQLClient;
private void button1_Click(object sender, EventArgs e)
{
string connStr = String.Format("server={0};port={1};uid={2};password={3};database={4}",
txtserver.Text, txtPort.Text, txtUser.Text, txtPassword.Text, txtDatabase.Text);
conn = new MySqlConnection(connStr);
try
{
conn.Open();
MessageBox.Show("Test Connection Succeded");
}
catch (MySqlException ex)
{
MessageBox.Show(ex.Message);
}
}
我不明白问题出在哪里。请帮我
I can't understand where the problem is. Please Help me
推荐答案
我有同样的问题。在我的情况下,只需运行该命令低于工作台连接在我的数据库:
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');
之后,我可以用connnect的MySQL Connector 6.6.5在C#code与普通MySQL连接字符串:
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;"
这篇关于旧密码验证不再被支持,使用4.1风格的密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!