I have problems connecting to my database. We have bought a cheap used windows 2012 IBM Server which is hooked up in our network. It has PHP 5.6 installed as well as SQL.
I've only worked with online servers so far and never had any connections problems untill now.
My connection script looks like this :
<?php
// Melde alle PHP Fehler
error_reporting(-1);
ini_set('display_errors', 1);
// Server in diesem Format: <computer>\<instance name> oder
// <server>,<port>, falls nicht der Standardport verwendet wird
error_reporting(E_ALL);
$serverName = "SQL\MSSQLSRV";
$connectionInfo = array('Database'=>'test', "UID"=>"username", "PWD"=>"password");
$conn = sqlsrv_connect($serverName, $connectionInfo);
if($conn) {
"Connection established.<br />";
}else {
"Connection could not be established.<br />";
die(print_r(sqlsrv_errors(), true));
}
?>
and thats the error I get :
Array ([0 ] = > Array ([0 ] = > 28000 [ SQLSTATE ] = > 28000 [ 1] = > 18456 [code ] = > 18456 [2 ] = > [ Microsoft] [ODBC Driver for SQL Server 11 ] [ SQL server] Login failed for user ' username ' . [message ] = > [ Microsoft] [ODBC Driver for SQL server 11 ] [ SQL server] Login failed for user ' username ' . ) [1 ] = > Array ([0 ] = > 28000 [ SQLSTATE ] = > 28000 [ 1] = > 18456 [code ] = > 18456 [2 ] = > [ Microsoft] [ODBC Driver for SQL server 11 ] [ SQL server] Login failed for user ' username ' . [message ] = > [ Microsoft] [ODBC Driver for SQL server 11 ] [ SQL server] Login failed for user ' username ' . ) )
Note I ve already changed the connection authentification to SQL Server and Windows Authentification Mode
I am glad for any help I get.
Aucun commentaire:
Enregistrer un commentaire