Trouble Connecting to sql server Login failed. "The login is from an untrusted domain and cannot be used with Windows authentication"
Trouble Connecting to sql server Login failed. "The login is from an untrusted domain and cannot be used with Windows authentication"
回答1
Getting rid of Integrated Security=true
worked for me.
回答2
If your SQL Server is on one domain controller and you are trying to connect to it from another domain controller then you will get this error when
IntegratedSecurity = true;
This will happen even if you include a valid SQL Server username and password in your connection string as they will automatically be over-written with your windows login and password. Integrated security means simply - use your windows credentials for login verification to SQL Server. So, if you are logged in to a different domain controller then it will fail. In the case where you are on two different domain controllers then you have no choice but to use
IntegratedSecurity = false;
Now, when Integrated security is false SQL Server will use the SQL Server login and password provided in your connection string. For this to work, the SQL Server instance has to have its authentication mode configured to mixed mode, being, SQL Server and Windows Authentication mode.
To verify or change this setting in SQL Server you can open the SQL Server Management Studio and right-click on your server name and then select Properties. On the pop-up that appears select Security and you will see where to alter this setting if you need to.
格式修改如下:
<connectionStrings>
<add name="DataAccess" providerName="System.Data.SqlClient" connectionString="database=Hotel;server=127.0.0.1,1433;UID=sa;PWD=123456;Current Language=English;Connection Timeout=120;" />
</connectionStrings>
相关文章
- windows命令——taskmgr 1
- Oracle 11g服务器安装详细步骤——图文教程(系统 windows server 2012 R2)
- 打开windows服务
- 让Windows Server 2008 + IIS 7+ ASP.NET 支持10万并发请求
- 搭建 Windows Server 2012 FTP 服务器
- windows下根据进程ID强制杀死进程
- Windows Server 2016 部署辅助AD域控制器
- SQL Server replication requires the actual server name to make a connection to the server.错误解决
- Windows Server 2008如何修改用户的密码
- windows server 2008系统安装SNMP服务
- Node.js is only supported on Windows 8.1, Windows Server 2012 R2, or higher
- AD域的安装(在Windows Server 2003中安装Active Directory)
- hadoop2.7.1 nutch2.3 二次开发windows环境
- android 解决报错 installation failed with message Failed to finalize session : INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION: Failed parse during installPackageLI: Failed to read manifest from /xx/xx/xx.apk
- Windows下FFmpeg高速入门
- adb server无法启动方法,结束占用端口的进程 windows 查杀进程
- 按照filebeat windows客户端
- 《Windows server 2019操作系统》搭建各种服务器综合运用
- 图解Windows下 GIT GUI 使用教程
- 安装CDH6.3版本的时候遇到 ‘ERROR main:com.cloudera.server.cmf.Main: Server failed’的解决方案
- 成功解决Windows和VM下的Ubuntu虚拟系统之间相互复制粘贴的问题
- Windows安装WSL进行机器学习(windows和Ubuntu同时使用)
- Zabbix-使用zabbix-agent监控windows主机
- Windows下搭建FTP服务,FileZilla Server