I am trying to run integration tests on an app and for this I need to have both an IIS Server and an SQL Server so I am trying to run an SQL Server as a service.
I applied an alias to it, so I could know what is the host name but it just fails to connect regardless.
test installer:
stage: Integration Test
image: mcr.microsoft.com/windows/servercore/iis
services:
- name: microsoft/mssql-server-windows-developer:2017-latest
alias: localhost_mssql
variables:
ACCEPT_EULA: 'Y'
sa_password: 'Sa123456'
tags:
- windows
script:
- "sqlcmd -S localhost_mssql -U sa -P Sa123456"
It can't locate the host:
Sqlcmd: Error: Microsoft SQL Server Native Client 11.0 : Named Pipes Provider: Could not open a connection to SQL Server [53]. .
Sqlcmd: Error: Microsoft SQL Server Native Client 11.0 : Login timeout expired.
Sqlcmd: 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 SQL Server Books Online..
I've read some threads about how I should enable SQL Browser Service but not sure how to do that or why wouldn't it work out of the blue.
What am I doing wrong here?
Related
I created an Amazon RDS database in SQL Server, created a custom security group with inbound rule type SQL Server protocal TCP Port "XXXX" Source "My PC's IP Address/32", allowed port "XXXX" over my firewall via "sudo ufw allow from any to any port "XXXX" proto tcp", successfully installed SQL Server on ubuntu via this tutorial: https://computingforgeeks.com/how-to-install-ms-sql-on-ubuntu/, and set 'public-accessibility' to 'no' in my AWS Database.
However, when I try to log in to my AWS Database from the command line via:
sqlcmd -S databasename.code.us-east-#.rds.amazonaws.com,XXXX -U username -P password -d DatabaseName
I get the error:
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : TCP Provider: Error code 0x102.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : 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 SQL Server Books Online..
I spelled everything correctly. What am I doing wrong?
Can you please check your network ACL's of your VPC and also make sure you have ephemeral ports allowed on your VPC ACL's.
https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html#nacl-ephemeral-ports
SQLCMD is by default using SQL Server Native Client 10.0 which is throwing below eror
T:\mno\pqr>sqlcmd -S 192.168.29.3 -U abc -P def -d ghi -i "jkl.sql"
HResult 0x15, Level 16, State 1
Encryption not supported on the client.
Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : Client unable to establish connection.
HResult 0x80090331, Level 16, State 1
SSL Provider: The client and server cannot communicate, because they do not possess a common algorithm.
Sqlcmd: Error: Microsoft SQL Server Native Client 10.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 SQL Server Books Online..
I need to reinforce SQL Server Native client 11.0 which fixes this issue (tried and tested via SSIS) but cant find the procedure. Please help
Try this folder: C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn
It works on mine:
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!
try use only sqlcmd -S IP
not IP\SQLEXPRESS
I installed SQL Sever before version 2016 and have updated. It is 2017 version now.
Now when I open SQL Sever I get this error:
Cannot connect to ..
Additional information:
A network-related or instance-specific error occurred while establishing a
connection to SQL Server. The server was not found or was not accessible.
Verify that the instance name is correct and that SQL Server is configured to allow
remote connections. (provider: Named Pipes Provider, error:
40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)
The system cannot find the file specified
I entered
Server Type: Database Engine
Server name: .
Authentication: SQL Server Authentication
Login: sa
Resolution:
While verifying the Services i found that the MSSQLSERVER service was stopped, after starting this service my issue was resolved.
I am having trouble connection to a local instance of Microsoft SQL Server 2012, this is what i have tried so far:
SQL Server Configuration Manager
Enable TCP/IP
Enable Named Pipes
Enable Shared Memory
The SQL Server, SQL Server Browser and SQL Server Agent services are all running.
I have verified that there is a SQL Server instance with: sqlcmd.exe -L this command gives me the following:
Servers:
(local)
MON-W530
SQLCMD
sqlcmd.exe -S MON-W530\MSSQLSERVER -E Gives the following output:
Sqlcmd: Error: Microsoft SQL Server Native Client 11.0 : SQL Server Network Interfaces: Connection string is not valid [87]. .
Sqlcmd: Error: Microsoft SQL Server Native Client 11.0 : Login timeout expired.
Sqlcmd: 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 SQL Server Books Online..
OSQL
OSQL.EXE -S MON-W530\MSSQLSERVER -E Gives the following output (Identical to sqlcmd.exe above)
[SQL Server Native Client 11.0]SQL Server Network Interfaces: Connection string is not valid [87].
[SQL Server Native Client 11.0]Login timeout expired
[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 SQL Server Books Online.
Its a fresh installation of Microsoft SQL Server 2012 Developer Edition, any help is appriciated.
Edit
Using SQL Server Management Studio 2012, i don't have the option to specify username and password for Windows Authentication, so i guess its not enabled, any clues on enabling Windows Auth is also appriciated.