1

I'm trying to create a connection to a SQL Server database in processmaker. It uses mssql_connect in order to make connection.

$link = @mssql_connect( $this->ip . $str_port, $this->db_user, $this->db_passwd );

But the problem is: $link is false (that means connection failed).

I tried to debug using echo mssql_get_last_message() and it printed Login failed for user 'myuser'.

I made sure user/password are correct and there is no mismatch, even connected to database using management studio successfully.

Another but: I checked SQL Server logs and found this:

Login failed for user 'myuser'. Reason: Infrastructure error occurred. Check for previous errors

The previous error is:

Error: 18456, Severity: 14, State: 1

which not helping.

Mind blowing... any help would be appreciated... I don't get why Infrastructure error occurred happens... the SQL Server version is 2017 and SQL authentication is set to both SQL + Windows authentication methods

SQL authentication option

Zhorov
  • 28,486
  • 6
  • 27
  • 52
mhesabi
  • 1,140
  • 3
  • 22
  • 48
  • On the next lines of `Error 18456` does the username contain a `$` ? This will determine if it's a Windows `Process` that can't log in or a Windows `User` -- And if this is a new error (the SQL worked before and does not now) make sure the password hasn't changed in Active Directory .... – Zak Jun 07 '21 at 17:43
  • @Zak the username does not contains `$` character and also mentioned previous error is `Error: 18456, Severity: 14, State: 1` period; there is no next lines. – mhesabi Jun 07 '21 at 17:50
  • You checked `ERRORLOG ` ?? Should be more information there .. – Zak Jun 07 '21 at 18:07
  • @Zak do you mean `Management > SQL Server Logs` ? – mhesabi Jun 07 '21 at 18:28
  • There should be an error log there -- Your problem could be that you are "set' to accept only Windows authentication .. You need to be set to Windows + SQL -- If the user doesn't exist it will cause the error .. Sometime SQL Server needs to be run in Elevated Mode .. There just isn't enough information to go on here .. It's a very broad error. – Zak Jun 07 '21 at 18:38
  • Yes, look there in the logs for further info. Are you using SQL Server Login or Windows Authentication login (AKA Trusted Connection AKA Integrated Security) – Charlieface Jun 07 '21 at 19:34
  • This was the first link when I googled `Infrastructure error occurred`. Does it help? Does processmaker let you specify a database? That may also help. https://techcommunity.microsoft.com/t5/sql-server-support/why-do-i-get-the-infrastructure-error-for-login-failures/ba-p/318817 – Nick.Mc Jun 08 '21 at 02:34
  • Depending on your driver you'll probably need a `:` or `,` character to delimit the port number from the server name. What happens if you try `$this->ip . ':' . $str_port` or `$this->ip . ',' . $str_port` instead? – AlwaysLearning Jun 08 '21 at 03:10
  • Given that it appears to be a login error, it's unlikely that the port is an issue – Nick.Mc Jun 09 '21 at 05:13

0 Answers0