如何使用Sql Cmd登录到远程Sql Server [英] How Do I Login To Remote Sql Server Using Sql Cmd

查看:925
本文介绍了如何使用Sql Cmd登录到远程Sql Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试连接我的远程服务器数据库并与我的客户端进行交互我使用以下slqcmd命令:



sqlcmd -S IPAddressOFServer \ MSSQLSERVER -U sa -P adminPass





adminPass是我服务器管理员帐户的密码

但我得到以下错误:



< img src =http://upload7.ir/uploads//117b86828dd7926b2082015db918a26f14b3861e.pngborder =0height =145width =742/>

i am trying to connect and interact with my remote server database form my client i use following slqcmd command :

sqlcmd -S IPAddressOFServer\MSSQLSERVER -U sa -P adminPass


adminPass is password of administrator account of my server
but i get following error :

<img src="http://upload7.ir/uploads//117b86828dd7926b2082015db918a26f14b3861e.png" border="0" height="145" width="742" />

推荐答案

1。检查您的服务器是否配置为接受远程连接: https://msdn.microsoft.com/en-us/ library / ms191464.aspx [ ^ ]

2.检查实例名称是否正确(或根本不需要)......

3.检查端口号是否为默认值 - 您必须提供如果没有!

-S参数的详细信息是: [protocol:] server [\ _instance_name] [,port]

https://msdn.microsoft.com/en-us/library/ms162773.aspx [<一个href =https://msdn.microsoft.com/en-us/library/ms162773.aspx\"target =_ blanktitle =新窗口> ^ ]
1. Check if your server configured to accept remote connections: https://msdn.microsoft.com/en-us/library/ms191464.aspx[^]
2. Check if instance name is correct (or need at all)...
3. Check if port number is the default - you have to provide it if not!
Details of -S parameter are: [protocol:]server[\instance_name][,port]
https://msdn.microsoft.com/en-us/library/ms162773.aspx[^]


这篇关于如何使用Sql Cmd登录到远程Sql Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆