Home >Database >Mysql Tutorial >.net 连接阿里云上的mysql数据库一直报错

.net 连接阿里云上的mysql数据库一直报错

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-06 09:33:031562browse

mysqlnet阿里云

代码如下:
using MySql.Data;
using MySql.Data.MySqlClient;
static void Main(string[] args)
{
string str = "Database=chu;Data Source=rdsja29d3bs0j0z1jg55.mysql.rds.aliyuncs.com;Port=3306;User Id=XXX;Password=XXX;Charset=utf8";
MySqlConnection conn = new MySqlConnection(str);
conn.Open();

}

每次在conn.open()这里都会提示:
Unable to connect to any of the specified MySQL hosts.

换了好几个DLL都不行。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn