SQL Server Express LocalDB是否可以远程连接? [英] Can SQL Server Express LocalDB be connected to remotely?

查看:2965
本文介绍了SQL Server Express LocalDB是否可以远程连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个桌面应用程序使用新的SQL Server Express LocalDB(我认为它是代码命名为Denali)。

I am looking into using the new SQL Server Express LocalDB (I think it is code named "Denali") for a desktop application.

它目前正在使用SQL Compact运行,但用户希望在网络上的多台PC之间共享数据库。不幸的是,这不是SQL Compact可以做的,所以我正在调查其他解决方案。

It is currently running with SQL Compact, but the user is wanting to share the database between multiple PCs on a network. Unfortunately this is not something that SQL Compact can do, so I am investigating other solutions.

客户端需要能够轻松地将数据库文件发送到其他网站或备份因为我有很多管理员知识需要备份和恢复。

The client requires the ability to send database files easily to other sites or to back them up to a flash disk, so I am avoiding going to SQL Express because there is quite a bit of "administrator" knowledge required to backup and restore.

所以,我的问题是,新的SQL Express LocalDB是否支持通过网络和/或通过共享网络文件夹与mdf文件的远程连接?

So, my questions is, does the new SQL Express LocalDB support remote connections to the database over a network and/or through a shared network folder with the mdf file in it?

LocalDB支持

注意:此问题适用于连接字符串(AttachDbFileName)中的附加本地数据库的路径。 LocalDB的新版本的SQL Express'Denali',而不是SQL Server Express 2008或之前的版本。
请参阅本文中宣布LocalDB发布的文章: http://blogs.msdn.com/b/sqlexpress/archive/2011/07/12/introducing-localdb-a-better-sql-express.aspx

NOTE: This question pertains to "LocalDB" the new version of SQL Express 'Denali' and not to SQL Server Express 2008 or prior. See article here announcing LocalDB's release: http://blogs.msdn.com/b/sqlexpress/archive/2011/07/12/introducing-localdb-a-better-sql-express.aspx

推荐答案

否,SQL Server Express LocalDB 不接受远程连接。

No, SQL Server Express LocalDB doesn't accept remote connections.

使用共享网络文件夹的想法可能有效,但前提是您能够确保在尝试复制文件之前关闭LocalDB实例。还要记住,只有一个LocalDB实例可以同时打开任何给定的数据库文件。并且不要忘记日志文件!

The idea with shared network folder might work, but only if you are able to make sure the LocalDB instance is shutdown before you try to copy the file. Also keep in mind that only one LocalDB instance can have any given database file open at the same time. and don't forget about the log files!

其他安全警告:与SQL Server Compact数据库不同,SQL Server Express数据库(包括LocalDB数据库)不是作为安全数据设计的交换格式。例如,它们可以包含嵌入在其中的.NET程序集中的恶意代码。因此,您不应该从不受信任的来源打开数据库。

Additional security warning: unlike SQL Server Compact databases, SQL Server Express databases (including LocalDB ones) are not designed as secure data exchange format. For instance, they can contain malicious code in .NET assemblies embedded in them. So you should never open databases from untrusted source.

也许为客户提供一个自动备份过程的简单工具会是一个更好的主意?

Maybe providing the customer with a simple tool that automates the backup process would be a better idea?

这篇关于SQL Server Express LocalDB是否可以远程连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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