Ock
Ock

Reputation: 1

Can not connect to remote SQL Server using sqlcmd

I have a Microsoft SQL Server, running in a Window Server 2012 R2 Standard. The configuration for this SQL Instance is: Servername: IP\SQLEXPRESS( IP here is the IP address of the Window Server) with SQL authentication username and password.

I would like to connect to this remote database from my local machine, so I installed sqlcmd on my local machine Win 7, and tried the syntax to connect to this remote server: sqlcmd -S IP\SQLEXPRESS -U username -P password, but then I got some error messages:

Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : SQL Server Network Inte rfaces: Error Locating Server/Instance Specified [xFFFFFFFF]. .

Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Login timeout expired.

Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : A network-related or in stance-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 i f SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..

I searched some solutions in the Internet and did some configurations for the SQL Server, such as: enabled remote connection in SQL Server, activate TCP/IP Protocol, open incoming TCP Port 1433 by defining new rule in Windows Firewall of remote server, open outgoing TCP Port 1433 in my local Win 7 machine. But it seems there changes are not work in my case. Can anyone give me some hints here to fix this remote connecting problem?

Thank you in advance!

Upvotes: 0

Views: 4629

Answers (1)

Shaybakov
Shaybakov

Reputation: 756

try use only sqlcmd -S IP not IP\SQLEXPRESS

Upvotes: 1

Related Questions