Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect to a local database in SQL Server Management Studio?

I have downloaded the SQL Server Management Studio (SSMS) 2016 to recover a huge .bak file which is an old backup of a database. But first of all I need to connect to a DB Server.

After install, I execute SSMS and it asks me to connect to a DB Server. I don't have any and I saw that it is possible to create a "local" db by typing only a dot '.' for Server Name and use Windows authentication.

It is not working; how to do it?

like image 624
Alex Avatar asked Apr 06 '17 13:04

Alex


People also ask

How do I connect to a local SQL Server Management Studio?

Connect to the SQL Server using SSMS Next, from the Connect menu under the Object Explorer, choose the Database Engine… Then, enter the information for the Server name (localhost), Authentication (SQL Server Authentication), and password for the sa user and click the Connect button to connect to the SQL Server.

How do I connect to a local database?

To connect to your LocalDB instance with DataGrip, check if your LocalDB instance is ready for a connection. To do that, locate SqllocalDB.exe and run the following command in a command prompt: You will see a list of available LocalDB instances on the server.

How do I Login locally in SQL?

In Windows, click Start, point to Programs, point to Microsoft SQL Server, and then click Enterprise Manager. Expand the node for the server, and then expand the node for the database for which you want to grant user rights.


2 Answers

Open SSMS -> Connect, and for the server name type: (LocalDb)\MSSQLLocalDB, and choose Windows Authentication.

For a reference:

enter image description here

like image 134
Xin Avatar answered Sep 21 '22 19:09

Xin


You need to download and install SQL LocalDB. It is a special edition of SQL Server that does not allow remote connection and supports windows integrated authentication only. It is a simple one click MSI install so it is easy to deploy.

To download and install SQL Server 2016 Express, go to SQL Server downloads. LocalDB is a feature you select during installation, and is available when you download the media. If you download the media, either choose Express Advanced or the LocalDB package.

The above means that now you have to download and run a small downloader (cca 5 MB), select LocalDB (44 MB) and the Microsoft downloader will download MSI package to the folder you select. Then just run MSI package and LocalDB gets installed.

like image 37
Vojtěch Dohnal Avatar answered Sep 17 '22 19:09

Vojtěch Dohnal