[Solved-3 Solutions] Login Failed - Error: 18456, Severity: 14, State: 38 - Reason: Failed to Open the Explicitly Specified Database
- Login failed messages seen in the SQL Server ERRORLOG file.
- The connection string might have 'integrated security=true'. The connection string contains the user id and password that are to be used. Change the setting to false.
- First, we needed to figure out the account which is trying to access. If we look at the account which is shown in the error message is ending with “$” which means a machine account. In our case PORTAL01 was a front server in the SharePoint farm. This comes when there is some service, running under Local System account, it is trying to connect. This was SharePoint server which was trying to connect.
- State 38 of Login failed, is logged when the account is having insufficient access to the database (SharePoint_Config). To fix it, we need to connect to SQL Server using SSMS and navigat to the Security > Logins > Right click on the account, and go to properties. We need to click on “User Mapping” tab and there we might see that the login was not mapped with the database SharePoint_Config. It might be only mapped to the master database. Now, this explains the cause of the error messages in ERROLROG.
- Once we map that login to that mentioned database, we will stop receiving login failed error messages.
- While trying to log in to an SQL Server with multiple instances. The connection string might not name an instance. Once we name the instance (SERVERNAME\INSTANCENAME), we may to connect to the server.