php连接远程sqlserver08 失败?
$link=mssql_connect("XXX","XX","XX")ordie("cannotConnecttoDatabase");mssql_select_db(...
$link=mssql_connect("XXX","XX","XX") or die ("can not Connect to Database");
mssql_select_db("XXX");
echo "Success....";
exit;
结果报错为:
Warning: mssql_connect() [function.mssql-connect]: message: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. (severity 14) in D:\AppServ\www\web\action.php on line 3
Warning: mssql_connect() [function.mssql-connect]: message: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. (severity 14) in D:\AppServ\www\web\action.php on line 3
Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: CNSHA4MSQ02\Externals in D:\AppServ\www\web\action.php on line 3
can not Connect to Database
Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: CNSHA4MSQ02\Externals in D:\AppServ\www\web\action.php on line 3
can not Connect to Database
PS: php连接本地sqlserver已经试过没问题,php配置应该是好的,但是一旦连接远程sqlserver就报错,求高手解答!!!!!!!!!!!!!!!!!!!!!!!!!! 展开
mssql_select_db("XXX");
echo "Success....";
exit;
结果报错为:
Warning: mssql_connect() [function.mssql-connect]: message: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. (severity 14) in D:\AppServ\www\web\action.php on line 3
Warning: mssql_connect() [function.mssql-connect]: message: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. (severity 14) in D:\AppServ\www\web\action.php on line 3
Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: CNSHA4MSQ02\Externals in D:\AppServ\www\web\action.php on line 3
can not Connect to Database
Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: CNSHA4MSQ02\Externals in D:\AppServ\www\web\action.php on line 3
can not Connect to Database
PS: php连接本地sqlserver已经试过没问题,php配置应该是好的,但是一旦连接远程sqlserver就报错,求高手解答!!!!!!!!!!!!!!!!!!!!!!!!!! 展开
1个回答
展开全部
最有可能的就是ip地址以及用户名,密码等这三个中有一个是错误的;除了这个原因;现在php中默认的sqlserver驱动能连接的sqlserver版本是2000版的,不过我试过连接2005的也没有问题,这个你要检查一下;
连接的参数一般就是:
$conn=mssql_connect(DBHOST,DBUSER,DBPW);
远程的话DBHOST就是远程数据库的IP地址,
如:$conn=mssql_connect(‘211.555.147.14’,‘sa','111111');//注,也有可能会在ip地址上加上端口号;如:211.555.147.14:2240,如果不是冒号就是逗号分割
连接的参数一般就是:
$conn=mssql_connect(DBHOST,DBUSER,DBPW);
远程的话DBHOST就是远程数据库的IP地址,
如:$conn=mssql_connect(‘211.555.147.14’,‘sa','111111');//注,也有可能会在ip地址上加上端口号;如:211.555.147.14:2240,如果不是冒号就是逗号分割
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询