简体   繁体   中英

IIS cannot connect to SQL Server 2012 database ; Login failed for user .. Native Error Code:18456: Message:

I upgraded SQLServer 2000 database to SQLServer2012. After that IIS started throwing error:

Error: ERROR#1: return code:0, State:28000, Native Error Code:18456: Message:[Microsoft][SQL Server][SQL Server]Login failed for user ''. ERROR#2: return code:100, State:00000, Native Error Code:18456: Message:

  1. I can connect to the remote SQLServer 2012 database via ODBC 64 bit and 32 bit tool from IIS server with same user . No issues. is migrated from SQL Server 2000 to SQL Server 2012.
  2. Able to connect remotely using the same user via sqlcmd.
  3. Connected via Excel to the database using all connection tests works except IIS.

I created new user in SQLServer 2012 database and got the same error.

IIS configuration info below:

 <CfgSpecDataSource>
    <Connection>
DRIVER=SQL Server; SERVER=Server_IP; DATABASE=DB_NAME; UID=<db_user>; PWD=passed;</Connection>
  </CfgSpecDataSource>

I have mixed mode authentication (windows/sql server) defined on the sql instance.

Tried changing DRIVER=SQL Server Native Client 11.0 and got stuck with 18456 error;

Thanks to Vijunav Vastivch and sepupic for your suggestions.

1) This is a unique problem.

(Dropped the user and created again, tried with another new user ; no luck)

2) sepupic suggestion helped; I looked into the SQL Server Log and it displayed "Password did not match that for login provided"

Password was in UPPER case in the IIS configuration file. I narrowed down the possibilities of didn't match error and tried with lowercase password in configuration file. It worked.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM