如何远程连接到我的SQL Server(使用IP地址) [英] How to connect to my sql server remotly(Using IP Address)
问题描述
我正在使用mysql作为数据库,正在尝试使用IP地址远程连接mysql,
请帮助我如何使用C#远程连接到mysql,并使用Windows 7 OS.
Hi,
I am using mysql for db, am trying to connect mysql remotly using IP address,
please help me how to connect to mysql remotly using c# and am using windows7 os.
<add name="MySqlConnection" connectionString="Data Source=localhost;Initial Catalog=DbName;Username=Username;Password=1234;Pooling=false;Max Pool Size=500;Min Pool Size=1;"
providerName="MySql.Data.MySqlClient" />
这是我对mysql db的connectiong的连接字符串.我想输入数据源=本地主机"的IP地址.
我尝试提供IP地址,但未连接,而是由于"
This is my connection string for connectiong for mysql db. inpalce of "Data Source=localhost" i want to give IP address.
i tried giving ip address but it is not connecting, it is giving erros as "
Unable to connect to any of the specified MySQL hosts
"而给错误提示.
推荐答案
您好,
正如您已声明要使用MySQL服务器一样,请尝试使用以下格式的连接字符串:
Hi there,
As you have stated that you''re to using MySQL server, use try using this format of connection string:
ConnectionString="server=192.168.1.1;database=test;uid=test;password=test;pooling=false;";
将"192.168.1.1"替换为您的实际MySQL服务器IP地址.
希望这会有所帮助.
祝您编码愉快!
Replace "192.168.1.1" with your actual MySQL server IP address.
Hope this helps.
Happy Coding!
我希望这会有所帮助.
这篇关于如何远程连接到我的SQL Server(使用IP地址)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!