Cannot log in using SQL authentication ONLY from a remote server

12,774

From the SQL Server management studio, right click on your server (after connect) in the Object Explorer window and choose Properties.

On Security item, make sure that SQL Server And Windows Authentication mode is selected.

enter image description here

Share:
12,774
user990635
Author by

user990635

Updated on June 17, 2022

Comments

  • user990635
    user990635 almost 2 years

    I am trying to connect to SQL Server 2008 from a remote server using 'sa' username and its password (I can log in normally with this username and password from my own computer - so "SQL Server and Windows authentication mode" is chosen).
    In the SQL Server log file on my computer I see this error:

    Login failed for user 'sa'. Reason: An attempt to login using SQL authentication failed. Server is configured for Windows authentication only.

    I thought it might be a remote connection problem, so I checked that the remote connection in the properties is enabled, in the configuration manager I enabled TCP/IP and Shared Pipes and restarted the service afterwards and I created a firewall rule for port 1433. I also tried to turn off the firewall in case that it is being blocked somehow, but I got the same error.

    How this error appears only when accessing SQL Server from a remote server?
    How can I fix it?

  • user990635
    user990635 over 12 years
    It is selected, and it works well on my computer, the problem is only when trying to log in from a remote server
  • user990635
    user990635 over 12 years
    The 'sa' for tests :) I am connecting using a connection string: <add name="someName" connectionString="Database=someDB;Server=<myIP>;User=sa;Pass‌​word=12345" providerName="System.Data.SqlClient"/>
  • Stéphane Bebrone
    Stéphane Bebrone over 12 years
    Are you sure that you got the exact error message? Maybe it's a error due to your previous tries (check the timestamp). From where do you try to connect? An ASP.NET application? Can you catch the exception from there?
  • user990635
    user990635 over 12 years
    I am sure, exactly the same error (I checked the time) I am trying to connect from a web application using this connection string: <add name="someName" connectionString="Database=someDB;Server=<myIP>;User=sa;Pass‌​word=12345" providerName="System.Data.SqlClient"/>. The error from the log file of my application (on the server) is: "Login failed for user 'sa'", I can also copy the Stack Trace if it may help
  • Stéphane Bebrone
    Stéphane Bebrone over 12 years
    We can discuss it on the SQL Server chat room if you want.
  • lnu
    lnu over 12 years
    Don't forget to restart your sql server instance after this change.
  • benni_mac_b
    benni_mac_b over 12 years
    Restart anyway to ensure it running: maybe view stackoverflow.com/questions/8441158/…