Search code examples
flyway

SQL Server thinks I'm logging in with a machine account from flyway, but I'm not


Trying to use command line flyway to connect to SQL Server. Ports 1433 and 1434 are open on the firewall and tCPIP set up to use them on the SQLServer Config Manager.

From the flyway conf file:

flyway.url=jdbc:sqlserver:////<mymachineName>;databaseName=AdventureWorks2012
flyway.user=<username>
flyway.password=<password>

When I run

.\flyway info

I get something like:

+ ~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (ERROR: :String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

Unable to obtain connection from database (jdbc:sqlserver:////<myMachineName>;databaseName=AdventureWorks2012) for user '<username>': The TCP/IP connection to the host //<myMachineName>, port 1433 has failed. Error: "//<myMachineName>. Verify the connection properties. Make 
sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL State  : 08S01
Error Code : 0
Message    : The TCP/IP connection to the host //<myMachineName>, port 1433 has failed. Error: "//<myMachineName>. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make 
sure that TCP connections to the port are not blocked by a firewall.".

I also get a weird error in the sql error log:

Source      Logon

Message
Login failed for user '<domain_Name:MachineName$'. Reason: Could not find a login matching the name provided. [CLIENT: <local machine>]

Basically appears to be saying I'm trying to log in with a machine account. Any help welcome.


Solution

  • Too many slashed in the url? Should be only

    jdbc:sqlserver://<mymachineName>
                   ^^
                   Only two slashes here.