代码如下:
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都不行。