How to connect to SQL Server Express LocalDB
You can easily connect to your LocalDB instance with DataGrip. And as a first step, check if your LocalDB instance is ready for a connection. Locate SqllocalDB.exe and run the SqllocalDB.exe i
command in a terminal. You will see a list of available LocalDB instances on the server. You can connect to any of them.
Say, we want to connect to the v11.0 instance. First, we need to check its state by running SqllocalDB.exe i v11.0
command.
Currently, the instance is stopped (see the State
field). Let's start the instance by running SqllocalDB.exe s v11.0
in the terminal.
The instance is ready, you can launch DataGrip.
Open the Database view by pressing Alt+2 and click the Add icon () to add a new datasource, then select SQL Server (jTds)
.
In the connection window, select LocalDB in the dropdown list that is located next to the URL field. Then go to the Instance field and select the instance to connect to, in our case, it is v11.0
.
Open the Advanced
tab and find the DOMAIN
option and set it to the name of the machine where the instance is installed. If the instance is on your local machine, use the name of your computer.
Enter your access credentials and click Test connection.