Tutorial - Connect to SQL Server Local DB
Published 17 January 2025
Prerequisites:
- Download the jTds driver here.
- Extract jtds.1.3.3.jar and ntlmauth.dll from the zip
- Move jtds.1.3.3.jar to <install_dir>/flyway/drivers, and delete the existing jtds-1.3.1.jar.
- Move ntlmauth.dll to <install_dir>/flyway/native (only needed for Windows Authentication)
From the Flyway Desktop connection dialog:
- Selected jTds (LocalDB) using the driver dropdown
- Set the server name - note that jTds does not support using
localhost
as a server name. Use.
instead. - Set the instance name. The default localdb instance name is "MSSQLLocalDB".
- Enter the name of the database you want to connect to
- Ensure that both the Named pipe and Local DB checkboxes are checked
- 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):
- [environments.development]
- url = "jdbc:jtds:sqlserver://./development;instance=${localdb.pipeName};namedPipe=true;domain=mydomain"
- [environments.development.resolvers.localdb]
- 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".