LocalDB Connection Failed

Source: Internet
Author: User

An exception occurred while trying to connect to the database using the following connection string:

Data source= (LocalDB) \v11.0; Attachdbfilename=;initial catalog=master;integrated security=true; Enlist=false; asynchronous processing=true; Multipleactiveresultsets=true; Connect timeout=30.

To start manually by command line mode:

C:\users\liudy>sqllocaldb Start v11.0

Start of LocalDB instance "v11.0" failed because of the following error:error occurred during LocalDB instance startup:s QL Server process failed to start.

As LocalDB is a relatively new product, there is not much to be consulted on the Internet. Error found by viewing the log file "C:\Users\\AppData\Local\Microsoft\Microsoft SQL Server Local db\instances\v11.0\errorx.log": Unable to Open the physical file "C:\Users\\AppData\Local\Microsoft\Microsoft SQL Server Local db\instances\v11.0\model.mdf". Operating system error 32: "32 (another program is using this file and the process cannot access it.) )"。 That is, because the model file is occupied, the database instance cannot be started (Model.mdf is the template for the SQL Server database that created the user database, that is, the template database). Try renaming and the system is in use. Restart no results. Finally, it was resolved by means of violence. Download Unlocker (BTW: Operating system is 64-bit, remember to download the 64-bit version of the official website. Otherwise, the installation is unsuccessful, but cannot be used. http://www.emptyloop.com/unlocker/#download). Using Unlocker, the display cannot find the unlock, tries to rename it, and then prompts for a restart. After the reboot, the renaming was successful.

C:\users\liudy>sqllocaldb Start v11.0

LocalDB instance "v11.0" started.

Success! Reference: 1. Log and Model.mdf file location: C:\Users\\AppData\Local\Microsoft\Microsoft SQL Server Local db\instances\v11.0\ 2. Sqllocaldb Location:%ProgramFiles%\Microsoft SQL Server\110\tools\binn 3. Sqllocaldb use: http://www.csdn.net/article/2012-03-30/313753

LocalDB Connection Failed

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.