简体   繁体   English

用户客户端计算机的 SQL Server 登录失败

[英]SQL Server login failed for user client computer

I am using SQL Server r2 database as a remote server having mixed mode sql authentication.我正在使用 SQL Server r2 数据库作为具有混合模式 sql 身份验证的远程服务器。

When run my c# program from client computer to access database with following connection string:当从客户端计算机运行我的 c# 程序以使用以下连接字符串访问数据库时:

"Data Source=192.168.1.101\SQLEXPRESS,1433;Initial Catalog=Login; Integrated Security=true;Connection timeout=30; User ID=sa;Password=23456"

and facing an error:并面临错误:

Login failed for user 'VAIO\Guest'.用户“VAIO\Guest”登录失败。

VAIO is remote PC. VAIO 是远程 PC。

you are using Integrated Security=true which denotes that sql will try to login using Windows authentication.您正在使用Integrated Security=true表示 sql 将尝试使用 Windows 身份验证登录。 It seems that this windows user is not a valid login for sql server.看来这个 windows 用户不是 sql server 的有效登录名。 If you want to use user and password set:如果要使用用户和密码集:

Integrated Security=false

it worked for me.它对我有用。 use Sa user id and password...使用 Sa 用户名和密码...

"Data Source=192.168.8.106\PEBB, 1433;Initial Catalog=d2;Integrated Security=False;user id=sa;password=123;Connect Timeout=30"```

Add one space before port no.端口号前加一格Data Source=192.168.1.101\SQLEXPRESS, 1433数据源=192.168.1.101\SQLEXPRESS, 1433

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM