首页 > 解决方案 > Database Connection error using sql server and codeigniter in IIS

问题描述

Error to connect MSSQL database through PHP I can't able to connect to sql server database in remote system. It is showing Unable to connect to your database server using the provided settings. Filename:

returns the bellow error..

Array ( [0] => Array ( [0] => 28000 [SQLSTATE] => 28000 [1] => 18456 [code] => 18456 [2] => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Login failed for user 'NT AUTHORITY\IUSR'. [message] => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Login failed for user 'NT AUTHORITY\IUSR'. ) [1] => Array ( [0] => 42000 [SQLSTATE] => 42000 [1] => 4060 [code] => 4060 [2] => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Cannot open database "pestcontrol" requested by the login. The login failed. [message] => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Cannot open database "pestcontrol" requested by the login. The login failed. ) )

标签: phpsql-servercodeigniteriisdatabase-permissions

解决方案


这可以解决你的问题

$db['default']['username'] = 'root';
$db['default']['password'] = '';

它是 xampp、lampp 和 wampp 中的默认设置。如果您想创建自己的凭证,您可以在给定的代码中编写它。

或试试这个链接:

https://www.c-sharpcorner.com/UploadFile/specialhost/how-to-fix-login-failed-for-user-nt-authority-iusrs-in-share/


推荐阅读