开发者

this user is not associated

Machine X (hoste开发者_JAVA百科r pc with SQL Server 2005 Express edition installed and also known as development PC)

Machine Y (unknown user or guest)

I can both set and get data from machine X but when friends try to do that they get the following error

the user is not associated with a trusted sql server connection

I use windows auth.. my connection string is the following:

string ConnectionString="Data Source=IP.IP.IP.IP,1433;Network Library=DBMSSOCN;Initial Catalog=master;Integrated Security=SSPI;";

I checked everything but it seems like a permission problem in SQL or my computer. the firewall is turned off and so is AVG antivirus

Thanks in advance


The error means pretty much what it says - the SQL Server can't authenticate the user.

This typically happens when the user is not logged in as a member of the domain, for instance, if they're logging in to their machines under an account that is specific to that machine instead of using their domain account.

There are a few ways around this.

  1. The most obvious is to make sure that they are logged in to their machines as the domain user.

  2. Grant rights to the SQL server to the user accounts that they are using. Not sure how to do this if their machine isn't a member of a domain.

  3. Recommended approach Tthey can modify their SQL Server Management Studio shortcut (or create a new one) to use the runas command, which will run the specified executable using the credentials you provide (ie, they impersonate a different user for the purposes of that application and actions it performs). They'll need a user account in the server in order for this to work.

Example:

C:\Windows\System32\runas.exe /netonly /user:MYDOMAIN\USERNAME ssms.exe

When you run this, you'll be prompted for the password for the user mydomain\username. I use this to connect to my SQL Server at work when VPN'ing from my home machine, and it works fine.

Another, slightly simpler option is to have them connect using SQL Server Authentication. You'll need to create a SQL Server account either for each user, or a generic account that they all can use, and, of course, give them the password.


Ivan, you are using the Windows Authentication Mode (Windows Authentication) , you have two options to deal with your issue.

1) Change to SQL Server Authentication, to do this in your connection string you must provide the credentials (login and password) every time that they connect and verify which your Sql Server is running in SQL Server Authentication Mode and Windows Authentication mode. check this page to see alternatives to your current connection string.

2) Keep the Windows Authentication Mode. you must add the account of the user to the windows server where SQL server is running.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜