[help!!] SQL Server2005 连接的问题

[复制链接]
查看11 | 回复5 | 2006-3-28 11:39:00 | 显示全部楼层 |阅读模式
请大家帮我看看这些错误应该怎么解决:
C:\Documents and Settings\Administrator>osql -E -S"localhost,1433"
[SQL Native Client]TCP Provider: 由于目标机器积极拒绝,无法连接。
[SQL Native Client]Login timeout expired
[SQL Native Client]An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.
C:\Documents and Settings\Administrator>osql -E -S localhost
\MSSQLSERVER
[SQL Native Client]SQL Network Interfaces: Connection string is not valid[87].
[SQL Native Client]Login timeout expired
[SQL Native Client]An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.
如何才能连接上呢?
回复

使用道具 举报

千问 | 2006-3-28 11:39:00 | 显示全部楼层
没装 2005 不清楚.
你可以尝试
1,服务是否已启动
2,执行osql命令时密码是否正确
3,验证模式是如何选择的, 我还是偏向于混合验证.
回复

使用道具 举报

千问 | 2006-3-28 11:39:00 | 显示全部楼层
我已经确认了:
0.sql server服务started
1.认证是混合模式,并且任何一种都能连上打开sql server managementstudio
2.server 和client都打开了tcp/ip 和命名管道,telnet server 1433不报错
还有可能是别的什么引起的吗???
或者是不是我用的命令不对呀,一般都用什么命令来测试连接呢???
急死我了。。。
回复

使用道具 举报

千问 | 2006-3-28 11:39:00 | 显示全部楼层
假设你的sa帐户的密码为aaa
试一下
osql -Usa -Paaa
看看能不能正常进入.
回复

使用道具 举报

千问 | 2006-3-28 11:39:00 | 显示全部楼层
osql -Usa -Paaa
就出来了个
1>
这样能证明连上了吗?
原来那两种连接方式错在那里了?因为我的目的不只是连接上,要运行一个sql文件,建一个database然后再建一堆表,运行的时候就报这种错
[SQL Native Client]An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.
回复

使用道具 举报

千问 | 2006-3-28 11:39:00 | 显示全部楼层
是的,表示连上了.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行