Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 5 down vote accepted

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
share|improve this answer

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.