First article-vs local DB database connection failed, creating instance failed solution

Source: Internet
Author: User

Used for a long time localdb, do not have so many SQL components feel very good, not long before debugging code encountered a problem, vs suddenly connected not to LocalDB, pondering the afternoon, in fact, there is a very simple method.

The first step is to find the SQL Local DB version, I use VS2013, so it is V11.0, or can be played in CMD sqllocaldb versions

In this case, the default instance is v11.0, of course, if you do not use this instance of the project, then it is not necessary.

The second step, find the instance of the folder, I use the WIN8 system, my path is C:\Users\ user name \appdata\local\microsoft\microsoft SQL Server Local DB There is a instances folder underneath this folder, which is all the current instances.

The third step, in the CMD to delete the current project start instance, if it has been started, then stop, I use v11.0.

This will remove the success, if the prompt fails, skip to the next step.

Fourth, delete the deleted instances folder under the LocalDB path. If the third step is completed properly, then the instance folder under the instances only a few log files, delete this folder is OK, if the third step is wrong, can not delete the situation, then directly delete this folder, do not control the other.

The fifth step, the deletion is complete, then you can re-create, the name and just deleted the same line. -S means that the direct launch instance is created. If you do not add the-s parameter when you create it, start the instance yourself when you are finished creating it.

This is done, generally for localdb common errors, such as error codes 23, 40, 50 can be resolved.

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.