无法使用netbeans连接到sql server数据库

问题描述:

我正在使用Netbeans为本地SQL Server数据库创建一个CRUD应用程序。当我尝试创建连接到数据库,我得到一个错误:无法使用netbeans连接到sql server数据库

The TCP/IP connection to the host localhost, port 1433 has failed. Error: "Connection refused: connect. Verify the connection properties, check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.

Screenshot of a problem

我得到这个错误,虽然,我已经启用了TCP/IP为我在SQL Server条目配置管理器和我不使用防火墙。 Configuration Manager

尝试了一切从this,没有帮助。 有什么建议吗?

+0

您可以启用[登录审计(http://stackoverflow.com/a/6769173/950462)在SQL Server Management Studio并找到[错误日志]的相关部分(HTTPS:/ /msdn.microsoft.com/en-us/library/ms187109(v=sql.90).aspx)? –

+0

这可能有助于诊断错误:尝试使用其他基于Java的软件(如dbVisualizer)进行连接。下载'tcpview'并检查端口1433是否打开。 – Marged

+0

打开的日志,没有任何登录失败 –

最后,我找到了解决方案。 我去了服务器属性 - >安全性,并将服务器身份验证从“Windows身份验证模式”更改为“SQL Server和Windows身份验证模式”。 如果在这种情况下有特殊的错误信息,可能会更容易找出是什么导致错误。

enter image description here