Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot connect to localhost/sqlexpress #118

Closed
Cottin opened this issue Oct 30, 2013 · 3 comments
Closed

Cannot connect to localhost/sqlexpress #118

Cottin opened this issue Oct 30, 2013 · 3 comments

Comments

@Cottin
Copy link

Cottin commented Oct 30, 2013

When setting the server to sqlexpress on localhost I get the exeption: getaddrinfo ENOTFOUND

var config = {
    userName: 'sa',
    password: 'mypassword',
    server: 'localhost/sqlexpress'
    server: 'LOCALHOST\\sqlexpress'
    server: 'LOCALHOST/SQLEXPRESS'
    server: 'LOCALHOST\\SQLEXPRESS'
    // note: I only use one of these at a time
  };

If it helps, when setting the server to just localhost I instead get a ECONNREFUSED.

Is there a problem in the lookup fo localhost\sqlexpress?

@pekim
Copy link
Collaborator

pekim commented Oct 30, 2013

Microsoft style strings of hostname\instancename are not supported.

The server value must be a hostname (that can be resolved to an ip address) or an ip address. Pretty much the first thing that tedious will do when creating a connection is to open a tcp connection to the server on port 1433 (default). So all that is need is needed is a hostname (or ipaddress) and an optional port.

The sql server instance must be configured to accept tcp connections on port 1433 (or other port of your choice).

An alternative to knowing the port is to specify a value for options.instanceName (see http://pekim.github.io/tedious/api-connection.html#function_newConnection), but support for this may be more complicated to configure on the server.

@Cottin
Copy link
Author

Cottin commented Oct 30, 2013

Ok, thank you!

I couldn't get the configurations right on my sql server for options.instanceName to work but I set it up so that my named sqlexpress instance responded to port 1433 and then it sufficed with server: 'localhost' to connect.

If anybody else stumble upon this problem Zasz's answer on SO explains how to configure this: http://stackoverflow.com/questions/35026/sql-server-convert-a-named-instance-to-default-instance

@pekim pekim closed this as completed Oct 30, 2013
@oscartmxpgit
Copy link

Start your SQL Server Browser service, and don´t forget to enable TCP/IP in sql server configuration manager (configure TCP port under IPAll)
Next, I had to do this https://stackoverflow.com/questions/60226370/certificate-error-when-connecting-to-sql-server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants