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