0

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. ) )

Diamond
  • 117
  • 1
  • 9
  • *"Cannot open database "pestcontrol" requested by the login. The login failed."* ... that's pretty specific, the login failed - which is not hugely surprising since you've not defined a `username` or `password` in `database.php` – CD001 Jun 26 '19 at 12:50
  • becoz windows authentication only using – Diamond Jun 26 '19 at 12:59
  • so no need to specify username and pasword right? – Diamond Jun 26 '19 at 13:00

1 Answers1

0

This can be solve your problem

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

It is by default setting in xampp, lampp and wampp. If you want create your own credential you can write it in the code given.

or try this link:

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

Anand Pandey
  • 2,025
  • 3
  • 20
  • 39