如何使用Windows窗体应用程序连接远程mysql数据库 [英] How to connect remote mysql database using windows forms application

查看:109
本文介绍了如何使用Windows窗体应用程序连接远程mysql数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用Windows窗体应用程序连接远程mysql数据库。



i将本地数据库连接到Windows应用程序。但我想使用Windows窗体应用程序连接远程数据库。 div class =h2_lin>解决方案

修改你的连接字符串:

 Server = myServerAddress; Database = myDataBase; Uid = myUsername ; Pwd = myPassword; 



如果您使用的是tcp端口,那么:

 Server = myServerAddress; Port =  1234 ; Database = myDataBase; Uid = myUsername; Pwd = myPassword; 







- Amit


您好,



输入远程机器的IP地址,用户名和密码在应用程序的连接字符串中。



注意:远程机器应具有静态ID地址....


MySqlConnection con = new MySqlConnection(server = serverip; Use r ID = root;密码=密码;数据库= abc; pooling = false;允许零日期时间=真;);



它连接到远程数据库。

How to connect remote mysql database using windows forms application.

i connected local database to windows application.But i want to connect remote database using windows forms application.

解决方案

Modify your connection string like this:

Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;


If you are using a tcp port then:

Server=myServerAddress;Port=1234;Database=myDataBase;Uid=myUsername;Pwd=myPassword;




--Amit


Hi,

Enter the remote machine's IP address, user name and password in connection string of your application.

Note : the remote machine should have a static ID address....


MySqlConnection con = new MySqlConnection("server=serverip;User ID=root;Password=password;database=abc;pooling=false;Allow Zero Datetime=True;");

it is connected to the remote database.


这篇关于如何使用Windows窗体应用程序连接远程mysql数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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