0
votes

I'm trying to connect to SQL Server but I always get the following error code:

Array ( [0] => Array ( [0] => 28000 [SQLSTATE] => 28000 [1] => 18456 [code] => 18456 [2] => [Microsoft][SQL Server Native Client 11.0][SQL Server]Accesso non riuscito per l'utente 'NT AUTHORITY\SYSTEM'. [message] => [Microsoft][SQL Server Native Client 11.0][SQL Server]Accesso non riuscito per l'utente 'NT AUTHORITY\SYSTEM'. ) [1] => Array ( [0] => 42000 [SQLSTATE] => 42000 [1] => 4060 [code] => 4060 [2] => [Microsoft][SQL Server Native Client 11.0][SQL Server]Impossibile aprire il database "CMR" richiesto dall'account di accesso. Accesso non riuscito. [message] => [Microsoft][SQL Server Native Client 11.0][SQL Server]Impossibile aprire il database "CMR" richiesto dall'account di accesso. Accesso non riuscito. ) [2] => Array ( [0] => 28000 [SQLSTATE] => 28000 [1] => 18456 [code] => 18456 [2] => [Microsoft][SQL Server Native Client 11.0][SQL Server]Accesso non riuscito per l'utente 'NT AUTHORITY\SYSTEM'. [message] => [Microsoft][SQL Server Native Client 11.0][SQL Server]Accesso non riuscito per l'utente 'NT AUTHORITY\SYSTEM'. ) [3] => Array ( [0] => 42000 [SQLSTATE] => 42000 [1] => 4060 [code] => 4060 [2] => [Microsoft][SQL Server Native Client 11.0][SQL Server]Impossibile aprire il database "CMR" richiesto dall'account di accesso. Accesso non riuscito. [message] => [Microsoft][SQL Server Native Client 11.0][SQL Server]Impossibile aprire il database "CMR" richiesto dall'account di accesso. Accesso non riuscito. ) )

My PHP code:

$serverName = "UTENTE-PC\SQLEXPRESS";

$connectionInfo = array( "Database"=>"CMR");
$conn = sqlsrv_connect( $serverName, $connectionInfo);

I don't understand what do I have to do!?

P.S. I'm using WAMP

1

1 Answers

0
votes

Putting Accesso non riuscito per l'utente 'NT' into Google Translator produces Login failed for user 'NT'. So it looks like you're using the wrong database credentials.