【发布时间】:2017-03-08 15:13:41
【问题描述】:
我正在尝试在我的测试 WPF 应用程序和 MySql (phpmyadmin) 数据库之间创建连接。 现在,我尝试了其他有类似问题的主题的所有建议,但都没有奏效。
我有一个拥有所有权限的用户 (http://prntscr.com/ehhrdv) 和一个虚拟表。
我的连接代码如下所示:
string conectionString = "Server = r310.reseller.si; Database = ******; Uid = ******; Pwd = ******";
myConnection = new MySqlConnection(conectionString);
try { myConnection.Open(); } catch(MySqlException ex)
{
MessageBox.Show(ex.ToString());
}
我得到的错误:
MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.
at MySql.Data.MySqlClient.NativeDriver.Open()
at MySql.Data.MySqlClient.Driver.Open()
at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
at MySql.Data.MySqlClient.MySqlPool.GetConnection()
at MySql.Data.MySqlClient.MySqlConnection.Open()
at WpfApplication2.MainWindow.pressMe_Click(Object sender, RoutedEventArgs e) in C:\Users\Tomi\Documents\Visual Studio 2015\Projects\WpfApplication2\WpfApplication2\MainWindow.xaml.cs:line 51
我不确定我的用户是否没有远程连接或其他权限。
我正在从我工作的经销商网站管理数据库。
【问题讨论】: