“无法连接到WPF中的任何指定MySQL主机c#

时间:2014-09-29 06:44:57

标签: c# mysql wpf

我正在尝试从我的WPF应用程序连接到MySQL数据库,我已经设置了连接并检查了测试连接,并给我留言

"Test Connection Succeeded";

但是当我调试程序时,它会给我这样的错误信息:

"Unable to Connect to any of specified MySQL hosts";

请参阅我的代码:

server = "localhost";
        database = "xx";
        uid = "xx";
        password = "xxx";
        string connectionString;

        connectionString = "SERVER=" + server + ";" + "DATABASE=" + database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";";

        connection = new MySqlConnection(connectionString);

让我头疼的是如何应对这一个? 任何帮助将不胜感激。谢谢!!

0 个答案:

没有答案