Redgate Flyway

Tutorial - Connect to SQL Server Local DB

Prerequisites:

  1. Download the jTds driver here.
  2. Extract jtds.1.3.3.jar and ntlmauth.dll from the zip
  3. Move jtds.1.3.3.jar to <install_dir>/flyway/drivers, and delete the existing jtds-1.3.1.jar.
  4. Move ntlmauth.dll to <install_dir>/flyway/native (only needed for Windows Authentication)


From the Flyway Desktop connection dialog:

  1. Selected jTds (LocalDB) using the driver dropdown
  2. Set the server name - note that jTds does not support using localhost as a server name. Use .  instead.
  3. Set the instance name. The default localdb instance name is "MSSQLLocalDB".
  4. Enter the name of the database you want to connect to
  5. Ensure that both the Named pipe and Local DB checkboxes are checked
  6. Configure authentication - for Windows Authentication you will need to enter a domain. Otherwise, select SQL Server Authentication from the dropdown and configure your credentials, 

Add the following environment configuration to your toml configuration file (with appropriate environment id):

  1. [environments.development]
  2. url = "jdbc:jtds:sqlserver://./development;instance=${localdb.pipeName};namedPipe=true;domain=mydomain"
  3.  
  4. [environments.development.resolvers.localdb]
  5. instanceName = "MSSQLLocalDB"

Adjust the JDBC URL according to your needs. Note that jTds does not support using localhost as a server name. Use .  instead. The domain property is needed for Windows Authentication.

The default localdb instance name is "MSSQLLocalDB".



Didn't find what you were looking for?