无法连接到远程Asp.Net MySQL服务器 [英] Unable to connect to remote MySql server in Asp.Net

查看:185
本文介绍了无法连接到远程Asp.Net MySQL服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要通过asp.net连接到MySQL数据库。我使用的MySQL Connector进行与数据库的连接,但同时这样做,我有这个错误:


旧密码验证不再被支持,使用4.1风格的密码。


解决方案

从MySQL 4.1和更高版本,他们使用一种新的协议,不兼容早期版本。这就是为什么当你从早期版本服务器升级到4.1或更高版本您会收到验证错误消息。

如果您需要使用这两个客户端之前和之后4.1版连接到数据库,你必须有两个密码存储。一个旧的方式,一个新的途径。

您可以通过设置用户密码,以新的方式:

 设定密码为<用户名> = PASSWORD('新密码')
对于steve'@'10.15.2.67'= PASSWORD('我的安全密码')SET PASSWORD;

如果需要,您还可以使用密码设置为旧的方式:

 设定密码为<用户名> = OLD_PASSWORD('新密码')
SET PASSWORD FOR'steve'@'10.15.2.67'= OLD_PASSWORD('我的安全密码');

有在 MySQL手册,以细节有很大的页面过程

实际上,你可以对服务器是否有更新的4.1相比仍使用旧密码的方法但是这是不推荐

要做到这一点,你就可以开始使用<一个服务器href=\"http://dev.mysql.com/doc/refman/4.1/en/server-options.html#option_mysqld_old-passwords\">--old-passwords选项​​。

所以,无论是在服务器更新并您使用的是旧的客户端 - 或者你已经更新了客户端(现在使用新的密码系统)和您连接到服务器低于4.1

I needed to connect to MYSQL databases via asp.net. I am using MySQL Connector to make connection with database but while doing this I am having this Error:

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

解决方案

From MySQL 4.1 and higher they use a new protocol that is not compatible with earlier versions. Which is why when you upgrade the server from an earlier version to 4.1 or higher you receive the authentication error message.

If you need to connect to the database with both clients before and after version 4.1 you must have two passwords stored. One the old way and one the new way.

You can set a users password to the new way using:

SET PASSWORD for <username> = PASSWORD('new password')
SET PASSWORD FOR 'steve'@'10.15.2.67' = PASSWORD('my secure password');

If needed you can also set passwords to the old way using:

SET PASSWORD for <username> = OLD_PASSWORD('new password')
SET PASSWORD FOR 'steve'@'10.15.2.67' = OLD_PASSWORD('my secure password');

There is a great page in the MySQL manual which will detail the process

You can actually for the server if newer than 4.1 to still use the old password method however this isn't recommended.

To do this, you can start the server with the --old-passwords option.

So, either the server has updated and you're using a old client - or you've updated your client (which now uses the new password system) and your connecting to a server below 4.1

这篇关于无法连接到远程Asp.Net MySQL服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆