SQL 如何打开 .mdf 和 .ldf 文件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5927805/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to open .mdf and .ldf files?
提问by Failed_Noob
How to open .mdf and .ldf files ?
如何打开 .mdf 和 .ldf 文件?
These files were created using SQL 2005. I just installed SQL 2008.
这些文件是使用 SQL 2005 创建的。我刚刚安装了 SQL 2008。
I am unable to open this file. What am I am missing here ?
我无法打开此文件。我在这里缺少什么?
采纳答案by Fadrian Sudaman
You should be able to just attached the mdf file using SQL Server Mgmt Studio. See this link http://www.packtpub.com/article/moving-a-database-from-sql-server-2005-to-sql-server-2008-in-three-steps
您应该能够使用 SQL Server Mgmt Studio 附加 mdf 文件。请参阅此链接 http://www.packtpub.com/article/moving-a-database-from-sql-server-2005-to-sql-server-2008-in-three-steps
回答by JdMR
You probably just want to attach these and you can do that through SSMS.
您可能只想附加这些,您可以通过 SSMS 来完成。
However, if you really want to “read” these note that there is no default way to do so but there are some workarounds you can try.
但是,如果您真的想“阅读”这些请注意,没有默认方法可以这样做,但您可以尝试一些解决方法。
Reading .ldf file is only possible using third party tools such as ApexSQL Log.
读取 .ldf 文件只能使用第三方工具,例如ApexSQL Log。
There is also SQL Log Rescuewhich is free but only for SQL Server 2000.
还有免费的SQL Log Rescue,但仅适用于 SQL Server 2000。
Take a look at these thread for more details on this (if this is what you were after)
查看这些线程以获取有关此的更多详细信息(如果这是您所追求的)
Read the log file (*.LDF) in sql server 2008
读取sql server 2008中的日志文件(*.LDF)
回答by Avitus
You can't just open those files. But what you can do is attach them to your new version of SQL 2008. Here's the instructions to do that : http://msdn.microsoft.com/en-us/library/ms190209.aspx
你不能只打开那些文件。但是您可以做的是将它们附加到您的新版本的 SQL 2008。这是执行此操作的说明:http: //msdn.microsoft.com/en-us/library/ms190209.aspx
回答by PPC-Coder
In SQL Server management studio you can "Attach" an MDF file, which is associated with the LDF (log file).
在 SQL Server 管理工作室中,您可以“附加”一个与 LDF(日志文件)关联的 MDF 文件。
Alternatively, you can use Visual Studio's Server Explorer to attach to and browse MDF files.
或者,您可以使用 Visual Studio 的服务器资源管理器来附加和浏览 MDF 文件。