SQL Server Network Interfaces: Connection string is not valid [87]

风流意气都作罢 提交于 2019-11-28 04:06:17

问题


When I am running this from cmd on my SQL Server 2008 instance:

sqlcmd -U sa -S mymachinen_name\MSSQLSERVER

(where MSSQLSERVER is my instance name)

I get prompt for password and after that I get this:

Password:

HResult 0x57, Level 16, State 1 SQL Server Network Interfaces: Connection string is not valid [87].

Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..

Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : Login timeout expired.

I have my SQL Server browser service started and also I can login through Management Studio with Windows authentication.

Also found this KB article, but this is for SQL Server 2005/2000.


回答1:


Typically, the MSSQLSERVER service is the service of a un-named default instance.

Therefore, try this:

sqlcmd -U sa -S mymachine_name

(without specifying any instance name - just the machine name)




回答2:


It is set on installation, there is no default. Try to log on without a username



来源:https://stackoverflow.com/questions/28659796/sql-server-network-interfaces-connection-string-is-not-valid-87

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!