反正有没有从托管网站连接到本地SQL数据库? [英] Is there anyway to connect to local sql database from hosted website?

查看:97
本文介绍了反正有没有从托管网站连接到本地SQL数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个带有sql数据库的网站,并把它放在主机上......

我只想知道是否有办法当我在一台特殊的PC上打开我的网站时,我可以连接到PC的sql数据库进行读写...

让我知道是否有特殊的连接字符串!

I create a website with a sql database and put it on a host ...
I just wanna know if there is a way that when I open my website on a special PC, I could connect to the PC's sql database for reading and writing ...
let me know if there is a special connectionstring for that !

推荐答案

是的,你可以,但不推荐出于安全和性能原因。


要做到这一点,你需要:



1)拥有SQL Server的有效公共IP地址。

2)配置防火墙以通过端口1433到达上述服务器(内部IP地址) 。

3)在网络服务器上的连接字符串中使用上述有效的IP地址。
Yes you can but it is not recommended for security and performance reasons.

To do this you need to :

1) Have a valid public IP address for your SQL Server.
2) Configure your firewall to pass through port 1433 to the above server (internal IP address).
3) Use the above valid IP address in your connection string on your web server.


这篇关于反正有没有从托管网站连接到本地SQL数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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