Unable to connect to sql server database from another network - sql-server

I have an application server (Written in Python [Django]) running on one network and the sql server database on another network (due to security) and I am trying to get the values from that database to my application server. The error I am getting is:
OperationalError: ('08001', 'u'[08001] [Microsoft] [ODBC Driver 13 for SQL
Server] SQL Server Network Interfaces: Error Locating Server/ Instance
Specified [xFFFFFFFF]. (-1) (SQLDriverConnect); [08001] [Microsoft] [ODBC
Driver 13 for SQL Server] Login Timeout Expired (0); [08001] [Microsoft]
[ODBC Driver 13 for SQL Server] Invalid connection string attrbute (0);
[08001] [Microsoft] [ODBC Driver 13 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. (-1)')
Things I have already checked:
I am able to ping from the network where sql server database is to the application server network.
Remote connections is enabled on the sql server database.
Verified Windows firewall is not blocking the connection.
Verified there is a rule in firewall which allows all traffic from the sql server database to application server.
I have checked that the application works fine if I have the database server on the same network as the application server which means there is no error in the logic of the code.
Verified the connection string by logging into the database from the SSMS(On database network).
Verified that the IP allowall had tcp 1433.
After all this steps when I ran network monitor I saw the traffic going from my application server to the database server but there was no response from the database to my application server. Please let me know if I am missing something here. Thanks in Advance.

The link here helped me solve my problem.

Related

Need help connecting Microsoft SQL Server to Microsoft Power BI

I have recently joined a new company and I have a project where I am trying to connect a Microsoft SQL Server to Power BI to automate a report and I am running into some issues. I have successfully connected the server to a SQL environment in DBeaver so I know that the host name and port number are correct.
I have not successfully created an ODBC connection for though I have tried. Using the System DSN, I have tried both the SQL Server and the ODBC Driver 17 for SQL Server and both failed connecting. With the SQL Server option, I made up a name and user the following format for the server host:port and then used my windows NT credentials on the next page and left everything else as default all the way through testing the connection. I got the below error for this one:
Microsoft SQL Server ODBC Driver Version 10.00.19041
Running connectivity tests...
Attempting connection
[Microsoft][ODBC SQL Server Driver][DBNETLIB]Invalid connection.
TESTS FAILED!
For the ODBC Driver 17 for SQL Server option, I did the same settings with defaults and I got the below error:
Microsoft ODBC Driver for SQL Server Version 17.04.0000
Running connectivity tests...
Attempting connection
[Microsoft][ODBC Driver 17 for SQL Server]SQL Server Network Interfaces: Connection string is not valid [87].
[Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired
[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.
TESTS FAILED!
When I try and import the data into Power BI using the SQL Server option, and I put the host:port into the server slot and the SQL in its place, it then ask for me to sign in. I am using my windows credentials which is accurate and so I press connect and I get the below error:
"The server name provided doesn't match the server name on the sql server ssl certificate
Please contact your administrator or see the link below for more information. Alternatively,
you could change your Connection encryption settings. Would you like to continue using an
unencrypted connection?"
I am not sure how to fix this so I can run my SQL Server script in Power BI. Does anyone have any ideas?

Can’t connect to Microsoft SQL Server using Tableau online

I am getting the following error when I am going to create a new data source by connecting to SQL on premises database using Tableau online.
Can’t connect to Microsoft SQL Server
Detailed Error Message
There was an unknown connection error to the database. The error message below has additional information, but you might need to ask the database administrator to review the database logs. %1
[Microsoft][ODBC Driver 17 for SQL Server]MAX_PROVS: Error Locating Server/Instance Specified [xFFFFFFFF].
[Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired
[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.
Unable to connect to the Microsoft SQL Server server "my server name". Check that the server is running and that you have access privileges to the requested database.
2019-02-25 07:38:34.520, (XHObPax0w59qQPz8O0dV6QAAAIk,0:0)
Any idea to solve this issue?
You will need to use 'Tableau Bridge' to connect from online to on-prem.
https://onlinehelp.tableau.com/current/online/en-us/qs_refresh_local_data.htm
It's likely that you need to whitelist the Tableau Online IP addresses in your SQL Server instance. See the link for the addresses.
Tableau Whitelist Info

Connect to remote SQL Server - network-related or instance-specific error

I can't connect to a remote SQL Server.
I get this error:
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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
On the remote machine, the SQL Server is running and port 1433 is open.
In my Visual Studio Server Explorer, the data connection to the remote database shows a little red cross. The state is closed. - I can't see the remote pc in the server name select field. But I can successfully ping the remote computer.
How to connect to the server?
EDIT:
My connection string: {Data Source=wsbd0311\SQLEXPRESS;Initial Catalog=rms;User ID=sa;Password=mypassword} (I can login with this Id and password.)
I allready set "Allow remote connctions to this server" on the remote SQL Server.
EDIT No.2:
Do I need to have an open port 1434 on the remote SQL Server?
Make sure the server is running on the remote pc. Connect to the remote pc and check whether the SQL server instance is running on it by All Programs -> SQL Server -> SQL Server Configuration Manager -> Under SQL Server Services check whether the SQL Server service is on running state. If not try starting the service and connecting.
Furthermore Enable TCP/IP under the Protocols for MS SQL Server which comes under SQL Server Network Configuration.
You may be able to ping the server if the machine is turned on, but in order to connect to the SQL server instance, you should make sure that the SQL server is up and running on the server machine. Check this link for more details
How to Start, stop or restart SQL Server Instance

Cannot Connect to sql server using alias created with Sql Server Client Network Utility

I have created an alias to a Sql Server
with cliconfg.exe (Sql Server Client Network Utility) as below
(according to Setting Up a SQL Server Alias):
Server Alias: MyAliasSqlServer/Myinstance
Server Name: MysqlServer/Myinstance
Port: 1433
Unfortunately the alias doesn't work as
connecting with ODBC Data Source Administrator I get:
Microsoft SQL Server Native Client Version 11.00.3000
Running connectivity tests...
Attempting connection
[Microsoft][SQL Server Native Client 11.0]SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].
[Microsoft][SQL Server Native Client 11.0]Login timeout expired
[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.
TESTS FAILED!
The TCP/IP is enabled on the server and I manage to connect with the server name.
I have set aliases for both 32bit and 64bit
I have tryed setting alias on the sql Sever via Sql Server Configuration Manager
What else could I try?
You may need to use a backslash "\" instead of the forward slash.

Fail to connect to a remote SQL server with SQL Server 2008 Management Studio

I'm trying to connect to a remote database with SQL Server 2008 Management Studio. I got the following error:
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, Erreur : 53)
I think that I have wrong with my config:
Can someone help me please ?
Steps to find out what the reason is:
Does the SQL server allow remote connections? Main settings SQL Server
Is TCP/IP enabled for client connections and listen on correct IP address / NIC?
Does the firewall on the server allow incoming traffic for the SQL Server port (default 1433)
It is normally one of the 3 points above.

Resources