Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Connecting to SQL Express via SQLCMD errors Expand / Collapse
Author
Message
Posted Wednesday, November 7, 2012 3:33 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, September 15, 2014 6:16 AM
Points: 119, Visits: 449
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!

Post #1381875
Posted Wednesday, November 7, 2012 3:39 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: 2 days ago @ 8:38 AM
Points: 223, Visits: 1,725
Try sqlcmd -S .\Offline -U sa -P 123abc456
in windows environment, mostly you use backslash \ not slash /
Post #1381887
Posted Wednesday, November 7, 2012 3:54 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, September 15, 2014 6:16 AM
Points: 119, Visits: 449
Well you are a genius...

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

thank you!

Post #1381893
Posted Friday, February 1, 2013 9:06 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, February 11, 2013 1:53 AM
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
Post #1414727
Posted Monday, February 4, 2013 6:14 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Monday, September 15, 2014 8:17 AM
Points: 283, Visits: 1,116
@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
Post #1415259
Posted Monday, February 4, 2013 6:38 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, February 11, 2013 1:53 AM
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.
Post #1415269
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse