无法连接到SQL Server 2005 [英] Can't connect to SQL Server 2005
问题描述
我刚刚在我的机器上安装了SQL Server 2005,现在我试图通过SQuirrel SQL连接到它,但我很遗憾遇到了问题。
SQL Server 2005我选择混合模式进行身份验证,我已经设置了一个新的用户帐户,我试图连接。我还安装了Microsoft SQL Server JDBC驱动程序,我已成功使用SQuirrel SQL连接到远程服务器。
目前我正尝试通过指定
连接到我的数据库jdbc:sqlserver:// localhost:1433
输入我的用户名和密码后,我会收到以下错误:
test:与主机的TCP / IP连接失败。
java.net.ConnectException:Connection refused:connect
使用以下堆栈跟踪: / p>
com.microsoft.sqlserver.jdbc.SQLServerException:与主机的TCP / IP连接失败。 java.net.ConnectException:Connection refused:connect
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(未知源)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(未知源)
at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:133)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.execute(OpenConnectionCommand.java:97)
在net.sourceforge.squirrel_sql.client.mainframe.action.ConnectToAliasCommand $ SheetHandler.run(ConnectToAliasCommand.java:279 )
at net.sourceforge.squirrel_sql.fw.util.TaskExecuter.run(TaskExecuter.java:82)
at java.lang.Thread.run(未知来源)
最后,我已经检查以确保在SQL Server配置管理器中启用TCP / IP连接和命名管道。
如果任何人对我的问题有任何想法,我将非常感谢您听到他们。
所以经过一些更多的研究,结果是,我的sql服务器没有侦听到正确的端口。对于有这个问题的任何人,我建议阅读以下网页,这是非常有用的:
基本上,您需要将服务器配置为始终侦听某个端口我选择1433)并重新启动服务器。之后,它应该像一个魅力。
I just installed SQL Server 2005 on my machine and now I am trying to connect to it via SQuirrel SQL, but I am unfortunately running into problems.
When installing SQL Server 2005 I chose mixed mode for authentication and I have set up a new user account with which I am trying to connect. I also have installed the Microsoft SQL Server JDBC Driver and I have successfully used SQuirrel SQL to connect to a remote server before.
Currently I am trying to connect to my database by specifying
jdbc:sqlserver://localhost:1433
for the URL and selecting Microsoft SQL Server JDBC Driver.
After entering my username and password I am getting the following error:
test: The TCP/IP connection to the host has failed.
java.net.ConnectException: Connection refused: connect
with the following stack trace:
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source)
at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:133)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.execute(OpenConnectionCommand.java:97)
at net.sourceforge.squirrel_sql.client.mainframe.action.ConnectToAliasCommand$SheetHandler.run(ConnectToAliasCommand.java:279)
at net.sourceforge.squirrel_sql.fw.util.TaskExecuter.run(TaskExecuter.java:82)
at java.lang.Thread.run(Unknown Source)
One last thing, I have checked to make sure TCP/IP connections and named pipes are enabled in the SQL Server Configuration Manager.
If anyone has any thoughts on my problem I would be very grateful to hear them.
So after doing some more research, it turns out that my sql server was not listening to the correct port. For anyone else having this problem I recommend reading the following web page which was very useful:
Basically you need to configure your server to always listen on a certain port (I chose 1433) and restart your server. After that it should work like a charm.
这篇关于无法连接到SQL Server 2005的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!