简体   繁体   English

VS 2010 & SQL Server 2008:我正在尝试备份我的数据库(.mdf 文件)但不知道如何

[英]VS 2010 & SQL Server 2008: I'm trying to backup my database (.mdf file) but don't know how

I have a.mdf database I created in my App_Data directory for my site.我在我的网站的 App_Data 目录中创建了一个 .mdf 数据库。 I'm not sure how to back it up however.但是,我不确定如何备份它。 I was going to just copy/paste it to another drive but not sure that's actually backing it up as securely as I'd like.我打算将它复制/粘贴到另一个驱动器,但不确定它实际上是否像我想要的那样安全地备份它。 I know SQL Server 2008 has a back up option that creates a.bak file and everything but I can't seem to get my database to attach there and then be able to do that.我知道 SQL Server 2008 有一个备份选项,可以创建一个 .bak 文件和所有内容,但我似乎无法将我的数据库附加到那里然后能够做到这一点。 Any help would be greatly appreciated!任何帮助将不胜感激!

Open up Sql Server Managment Studio (SSMS).打开 Sql 服务器管理工作室 (SSMS)。 Attach your database by selecting the mdf file.通过选择 mdf 文件附加您的数据库。 It should pull in your ldf log file as well.它也应该拉入您的 ldf 日志文件。 Then you will be able to right click the database in object explorer and under tasks you can backup your database into a bak file.然后,您将能够在 object 资源管理器中右键单击数据库,然后在任务下您可以将数据库备份到 bak 文件中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM