3

I have a website that I need to access a sql server. In development using windows login worked fine, but now that I have deployed it to the webserver it cannot access the DB because it is running as the servers default user. So I am trying to have it login using a SQL Server login but no matter what I try it seems to fail.

Looking at the error log this is the message I find. Error: 18456 Severity: 14 State: 58 After googling for a bit I came here anyone know what State 58 is and how to fix it?

2 Answers 2

5

State 58 means that your SQL server is running in Windows Authentication mode, but you're trying to use a SQL login. In order to use SQL logins your server has to be running in mixed authentication mode.

Your options are to do one of two things:

  • Switch back to Windows authentication in your connection string
  • Change the server to mixed authentication so you can login with a SQL login. If you do this make sure you restart SQL.

To change your server to mixed authentication:

  • Right-click the server in Object Browser and choose Properties
  • Click Security in the menu on the left
  • Select SQL Server and Windows Authentication mode in the first heading (under Server Authentication)
  • Restart SQL
0

SQL Server logins are distinct from Windows logins. Are you sure the username and password you are entering matches one you have set up within SQL Server?

The easiest way to create logins is by using SQL Server Management Studio. You can follow this guide from Microsoft to create a login that uses either Windows authentication or SQL Server authentication. If your web and database servers are not joined to a domain, then the easiest way is to use SQL Server authentication.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .