Somee Server (somee.com)에서 PHP를 사용하고 Microsoft SQL에서 웹 사이트를 구축하고 있습니다. 이제 PHP와 SQL을 연결하는 데 문제가 있습니다. 여기 PHP에서 Microsoft SQL에 연결하는 데 문제가 있습니다.
내 접속 코드 :<?php
$serverName = "mssql.somee.com"; //serverName\instanceName
// Since UID and PWD are not specified in the $connectionInfo array,
// The connection will be attempted using Windows Authentication.
$connectionInfo = array("Database"=>"myDB","UID"=>"myusername","PWD"=>"mypassword");
$conn = sqlsrv_connect("mssql.somee.com", $connectionInfo);
if($conn) {
echo "Connection established.<br />";
}else{
echo "Connection could not be established.<br />";
die(print_r(sqlsrv_errors(), true));} ?>
그리고 그것은 나에게이 오류 반환 :
Connection could not be established. Array ([0] => Array ([0] => 28000 [SQLSTATE] => 28000 [1] => 18456 [code] => 18456 [2] => [Microsoft][SQL Server Native Client 11.0][SQL Server]Login failed for user 'jason_SQLLogin'. [message] => [Microsoft][SQL Server Native Client 11.0][SQL Server]Login failed for user 'jason_SQLLogin'.) [1] => Array ([0] => 28000 [SQLSTATE] => 28000 [1] => 18456 [code] => 18456 [2] => [Microsoft][SQL Server Native Client 11.0][SQL Server]Login failed for user 'jason_SQLLogin'. [message] => [Microsoft][SQL Server Native Client 11.0][SQL Server]Login failed for user 'jason_SQLLogin'.))
누군가가 그것에 대해 알고 있습니까? 매우 감사합니다. 정말 감사합니다.
'사용자가 로그인하지 못했습니다.'jason_SQLLogin''l 꽤 좋은 힌트가 있습니까? 어쩌면 암호 문제일까요? – fvu
예, "jason_SQLLogin"에 올바른 자격 증명, 액세스 수준 또는 기타 다른 권한이없는 것 같습니다. 하지만 이것은 매우 간단한 자격 증명 문제입니다. – JakeGould
고마워,하지만 계정과 암호가 올바른 것처럼 보입니다. ASP에서 mssql에 연결하는 데 사용한 이유는 무엇입니까? – Ben