SQL database MDF data file database restore _ MySQL

Source: Internet
Author: User
The. mdf file is a major data file in the database. it is the starting point of the database and points to other parts of the database file. When the computer fails and the database cannot be backed up, you can only use SQL commands to attach the. mdf data file to the current server to restore the original data. Open the query analyzer and click OK to connect to the server (enter the password if SA has a password ). the mdf file is a major data file in the database. it is the starting point of the database and points to other parts of the database file. When the computer fails and the database cannot be backed up, you can only use SQL commands to attach the. mdf data file to the current server to restore the original data. Open the query analyzer and click OK to connect to the server (enter the password if SA has a password), as shown below:

Go to the query Analyzer:

In the window on the right, enter the file recovery command in the format:
Sp_attach_single_file_db @ dbname = 'dbname'
, @ Physname = 'physical _ name'
Dbname: name of the database to be restored.
Physname: physical file name.
Physical_name: specifies the. mdf file path.

For example, the IT2000.mdf file is restored to the current server.

Click the execution button shown above to restore the original IT2000 Database. the command line prompts that the command has been executed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.