GoLand 2021.2 Help

Connect to SQL Server Express LocalDB

Step 1. Check and create a LocalDB instance

  1. To connect to your LocalDB instance with GoLand, 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.

    SqllocalDB.exe i
  2. Next, create a LocalDB instance. To create an instance, run the following command:

    SqlLocalDB create "DEVELOPMENT" 15.0 -s

    This command creates an instance of LocalDB named DEVELOPMENT by using SQL Server 2017 binaries and starts the instance. If you omit 15.0, the version number defaults to the version of the SqlLocalDB utility.

  3. To check an instance state, run this command.

    SqllocalDB.exe i MSSQLLocalDB
  4. Currently, the instance is running (see the State field). If you have the Stopped state, start the instance by running the following command in the terminal.

    SqllocalDB.exe s MSSQLLocalDB
    Check and create a LocalDB instance

Step 2. Create the LocalDB connection

  1. In the Database tool window (View | Tool Windows | Database), click the Data Source Properties icon The Data Source Properties icon.

  2. From the Driver list, select Microsoft SQL Server (jTds).

  3. At the bottom of the data source settings area, click the Download missing driver files link. As you click this link, GoLand downloads drivers that are required to interact with a database. The IDE does not include bundled drivers in order to have a smaller size of the installation package and to keep driver versions up-to-date for each IDE version.

    You can specify your drivers for the data source if you do not want to download the provided drivers. For more information about creating a database connection with your driver, see Add a user driver to an existing connection.

  4. From the Connection type list, select LocalDB.

  5. From the Instance list, select the instance to connect to (for example, DEVELOPMENT).

  6. From the Authentication list, select the authentication type:

    • User & Password requires a username and a password.

    • Windows credentials requires you to run GoLand on Windows in the same domain as the Microsoft SQL Server database. Works as the Single-Sign On (SSO).

    • Domain credentials requires a domain, a username, and a password.

  7. To ensure that the connection to the data source is successful, click the Test Connection link.

Create the LocalDB connection
Last modified: 27 August 2021