SQL Server Management Studio - Login failed for user (.Net SqlClient Data Provider)

I have a very strange problem.

When I try to connect my database (located on a shared SQL Server) with SQL Server Management Studio 2008/2012. This database hosted by the company for web hosting, I get this very strange error:

Unable to connect to tango.rdb.superhosting.bg.

Login failed for user 'database_administrator'. (Net SqlClient Data Provider)

Server Name: tango.rdb.superhosting.bg
Error Number: 18456
Weight: 14
State: 1
Line Number: 65536

A few weeks ago, everything worked perfectly, and I had no problems connecting SQL Server with SQL Server Management Studio 2008.

When I ran into this problem, I installed SQL Server Management Studio 2012 and the result will be the same.

But with the exact same credentials, I can connect to my database on the same server using VS2010 or Toad for SQL.

Do you have any suggestions?

Thanks in advance!

+4
source share
2 answers

This is probably a problem for an orphaned user.

The "database_administrator" entry can be:

  • In the database itself. Just go to Logins under the database in SSMS.
  • Or, under Server → Security Logins.

I usually do:

  • Delete an entry that exists in the database
  • Add Login Under Server Level Security
  • Grant the user the right to the database he needs

There are many ways to solve the problem of orphaned users, but usually this is what I do.

+3
source

Decision:

After installing the MS-Sql 2008 server, the Sql server is only allowed for Windows authentication.

To resolve this issue, follow these steps and enable the sa user in authentication mode.

1) In the SQL Server Management Studio Object Explorer, right-click the server and select Properties.

2) On the Security page, in the Server Authentication section, select the Sql server and Windows authentication mode, and then click OK.

3) In the SQL Server Management Studio dialog box, click OK to confirm the need to restart SQL Server.

To restart SQL Server from SQL Server Management Studio • In Object Explorer, right-click on your server and select Restart. If the SQL Server Agent is running, it must also be restarted.

4) To enable sa login using Management Studio, in Object Explorer, expand Security, Expand Logins, right-click sa, and select Properties.

5) On the General page, you may need to enter a new password and confirm the password to log in to sa.

6) On the Status page, in the Login section, click Enabled, and then click OK.

7), then restart SQL Server from SQL Server Management Studio again

0
source

Source: https://habr.com/ru/post/1501542/


All Articles