MSSQLLOCALDB databases aren't listed

David picture David · Dec 1, 2015 · Viewed 10.8k times · Source

I used the ASP.NET 5 Preview Templates in Visual Studio 2015 to create an ASP.NET 5 site. According to the config.json file, there's a database in (localdb)\mssqllocaldb.

I want to move that database to my actual SQL Server, but when I connect to the (localdb)\mssqllocaldb server in SQL Server Management Studio to start the backup process, there are no databases listed. Where is it?

Any idea on how I can migrate that database if I can't find it in SSMS?

Answer

John Youngtree picture John Youngtree · Dec 14, 2015

I had this problem also and just got it working (I'm doing the MVC-Movie MVC6 Tutorial - i'm just at the 'Adding a Model' section where you create a connection to a Local Database : here).

Visual Studio 2015/SQL Server 2014 uses a different path than 2012/2013. I previously had VS2012 and VS2013 installed and had created local databases in each. VS2012 created a connection as: (localdb)\v11.0 and SQL Server Data Tools (SSDT) as (localdb)\ProjectsV12.

To get the (LocalDB)\MSSQLLocalDB working you:

  1. Open CMD Prompt and type SQLLocalDB.exe info this shows all the current database servers on your local connection
  2. You should see an option here for MSSQLLocalDB. type SQLLocalDB.exe start MSSQLLocalDB It will tell you that this has now been started.
  3. Go to Visual Studio and click View -> SQL Server Object Browser From here you will need to add a SQL Server (right click on SQL Server and 'Add SQL Server'
  4. In Server name: field enter '(LocalDB)\MSSQLLocalDB' - the Username/Servertype/Authentication should be left as default. Upon clicking Connect, the new database will show up with your new database

Databases are now stored in c:\users\[DATABASE-NAME] where as previously they were stored in your C:\Users\\AppData\Local\Microsoft\VisualStudio\SSDT

Hopefully this solves your issue with finding the SQLServer, Cheers