An error occurred while attaching the database to SQL Server. Error Code 5123

Source: Internet
Author: User

Today, when attach a previous database (not in the directory where sqlserver is initially installed), it is always unable to be attached, and there is always a 5123 error.Code,

At first, I thought it was because sqlserver2008 was not compatible with the original database because the database was not known to be created in that version. I read it on the official website and explained that the permission was incorrect, put the database in the directory where sqlserver is installed, that is, X: \ Program Files \ Microsoft SQL Server \ mssql10.mssqlserver \ MSSQL \ data, which solves the problem; however, you cannot put the database in this directory every time! So I found other solutions;

Solution 1: Put the file in the default location of sqlserver, but it is best not to put it on the drive C. If the system is reinstalled that day, it will be over, haha;

Solution 2: Change the default database folder in the sqlserver real column, select the sqlserver instance, right-click the attribute, and click "database Settings" on the left, there is a "default database location". set this to your own directory.

Solution 3: Change the permissions of the folder where the database is located. Add an Everyone user and set it to "full control". This solution is direct and convenient;

Tag: Additional database, 5123, attachdatabase, error5123

Related Article

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.