SQL Server Express - 网站无法正常工作
我有一个正在尝试部署的新网站。它在我的本地计算机上运行良好,但是当我安装在服务器上时,它不再运行并且我没有收到任何错误消息。我正在使用 SQL Server Express,但服务器上未安装它。我需要这样做吗?
I have a new website that I'm trying to deploy. It works great on my local machine, but when I install on the server, it no longer works and I don't get any error messages. I'm using SQL Server Express, but this isn't installed on the server. Do I need to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
数据库可以位于与服务器连接的任何机器上。您所需要的只是在应用程序的连接字符串中给出托管数据库的计算机的路径
The database can be on any machine that is connected with the sever. All you need is to give the path of that machine hosting database in the connection string of your application
您需要确保在尝试连接的 SQL Express 上启用了 TCP/IP 设置,以便允许外部连接。
指定标准端口而不是通常分配的动态端口可能也是值得的,这样您就可以向防火墙添加例外,以允许在需要时通过此端口进行访问。
You need to ensure that you have TCP/IP settings enabled on the SQL Express you're trying to connect to in order to allow external connections.
It may also be worth while specifying a standard port rather than the dynamic ones it usually assigns so that you can add an exception to your firewall to allows access through this port if required.
当然,您需要在服务器中安装MS SQL或Express版本。然后,您需要将数据库复制到那里并修改 Web.config 中的连接字符串。
数据库服务器也可以位于另一台计算机上,只要它允许远程访问并且连接字符串设置正确即可。
Of course you need to install MS SQL or the Express version in the server. You then need to copy your database there and modify the connection strings in the Web.config.
The database server can also be located in another machine, as long as it allows remote access and the connection strings are set up properly.
好的,所以我的问题是 SQL Express 不存在于任何地方。我将其安装到服务器上,一切立即正常(除了更改我的集成安全性)。感谢所有的指点。
Ok, so my problem was SQL Express didn't exist anywhere. I installed it onto the Server and everything worked straight away (with the exception of changing my Integrated Security). Thanks for all the pointers.