Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSSQLLOCALDB databases aren't listed

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?

like image 458
David Avatar asked Dec 01 '15 20:12

David


People also ask

Where are LocalDB databases stored?

The system database files for the database are stored in the local AppData path, which is normally hidden. For example, C:\Users\<user>\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\LocalDBApp1\ .

How do you check if I have LocalDB installed?

Open "Command Prompt" Type line "sqllocaldb info" and check the name. By default, it will show "MSSQLLocalDB". Type line "sqllocaldb info MSSQLLocalDB"


1 Answers

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

like image 93
John Youngtree Avatar answered Sep 28 '22 02:09

John Youngtree