Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Connecting to SQL Express via SQLCMD errors


Connecting to SQL Express via SQLCMD errors

Author
Message
n00bDBA
n00bDBA
SSC-Enthusiastic
SSC-Enthusiastic (122 reputation)SSC-Enthusiastic (122 reputation)SSC-Enthusiastic (122 reputation)SSC-Enthusiastic (122 reputation)SSC-Enthusiastic (122 reputation)SSC-Enthusiastic (122 reputation)SSC-Enthusiastic (122 reputation)SSC-Enthusiastic (122 reputation)

Group: General Forum Members
Points: 122 Visits: 467
Hi all,

I cant connect to a sql express instance via sqlcmd and was hoping for some ideas!

Command line:

sqlcmd -S ./Offline -U sa -P 123abc456

So far:

SQL Browser is enabled
TCP/IP is enabled
Remote connections is enabled
firewall is turned off.

I can connect from the SQLCMD from the server with SQL Express on to another instance.

I can connect from SSMS on a client machine to the SQL Express instance

Im getting the following error:

Error: Microsoft SQL Server Native Client 11.0 : Named pipes Provider: Could not open a connection to SQL Server
Error: Microsoft SQL Server Native Client 11.0 : Login timeout expired.
Error: Microsoft SQL Server Native Client 11.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 BOL.


Hope someone can help!
e4d4
e4d4
SSC Veteran
SSC Veteran (275 reputation)SSC Veteran (275 reputation)SSC Veteran (275 reputation)SSC Veteran (275 reputation)SSC Veteran (275 reputation)SSC Veteran (275 reputation)SSC Veteran (275 reputation)SSC Veteran (275 reputation)

Group: General Forum Members
Points: 275 Visits: 2397
Try sqlcmd -S .\Offline -U sa -P 123abc456
in windows environment, mostly you use backslash \ not slash /
n00bDBA
n00bDBA
SSC-Enthusiastic
SSC-Enthusiastic (122 reputation)SSC-Enthusiastic (122 reputation)SSC-Enthusiastic (122 reputation)SSC-Enthusiastic (122 reputation)SSC-Enthusiastic (122 reputation)SSC-Enthusiastic (122 reputation)SSC-Enthusiastic (122 reputation)SSC-Enthusiastic (122 reputation)

Group: General Forum Members
Points: 122 Visits: 467
Well you are a genius...

very simple.. and rather annoying on my part....

thank you!
andy.gardner
andy.gardner
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 6
I am having the same problem. I've installed SQL Server 2012 on a Windows 8 machine. SQL Browser is enabled. Remote connections are enabled. Firewall has rules for SQL Server ports etc.

My SQL Server is called DELL-D830\SQLEXPRESS
My Server is on 192.168.200.149.

If I do sqlcmd on the machine local to the SQL Server, no problem, everything works fine.

If I do sqlcmd from a remote machine using command

sqlcmd -S DELL-D830\SQLEXPRESS -U andy -P andy

or

sqlcmd -S 192.168.200.149\SQLEXPRESS -U andy -P andy

Have also tried

sqlcmd -H 192.168.200.149 -S .\SQLEXPRESS -U andy -P andy

With all commands I try I get the same error messages as reported at the start of this thread.

Any ideas what I've missed or are there any known problems with MSSS on Windows 8?

cheers

Andy
Richard Fryar
Richard Fryar
SSC Veteran
SSC Veteran (289 reputation)SSC Veteran (289 reputation)SSC Veteran (289 reputation)SSC Veteran (289 reputation)SSC Veteran (289 reputation)SSC Veteran (289 reputation)SSC Veteran (289 reputation)SSC Veteran (289 reputation)

Group: General Forum Members
Points: 289 Visits: 1171
@andy.gardner

When you say "remote connections are enabled" are you referring to the TCP/IP protocol in Configuration Manager? If not, check it - it is disabled by default for SQL Express.

Have you also checked that you can ping and telnet from the remote machine?

P.S.
Just noticed you have added your question to an old thread - For future reference you will often get a quicker response if you start a new one.


Check Your SQL Servers Quickly and Easily
www.sqlcopilot.com
andy.gardner
andy.gardner
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 6
Thanks Richard. Yes I have enabled TCP/IP for remote connections. And I can ping the hosting machine from the remote machine.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search