Microsoft SQL Server Management Studio Connection to Azure database uses router ip address - sql-server

I am accessing an Azure Database via MS SQL Server 2014 Management Studio. I do not own the Azure database that I am connecting to.
I have connected to this database in the past (with occasional difficulties) but for some reason when I now use the Connect to Server I get the following error:
The odd thing is that IP referred to in the error message is my router's IP address as opposed to the IP addressed assigned to me (I checked my IP address using ipchicken(IPCHICKEN).
Does anyone know what is happening?

Just confirming that you are using Azure SQL Database as a service. In that case, you need to create a new SQL server firewall rule and add the ip that the error shows you there.
In the portal, Go to your SQL Server -> Settings -> Firewall -> Add client IP.
https://azure.microsoft.com/en-gb/documentation/articles/sql-database-get-started/
Azure is taking the ip address of your router and not your local ip. You can try using http://ifconfig.me/ip to get what is your external facing IP.

Related

#AzureDataFactory & linked services. SQL Server connection error

I am facing below error while connecting on premise SQL Server database in Azure Data Factory. I was establish a self hosted integration IR which running fine. Any one help on this please.
Cannot connect to SQL Database: '_&', Database: '', User: '________'. Check the linked service configuration is correct, and make sure the SQL Database firewall allows the integration runtime to access.
Cannot open server '____&' requested by the login. Client with IP address '223.196.174.128' is not allowed to access the server. To enable access, use the Windows Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range. It may take up to five minutes for this change to take effect., SqlErrorNumber=40615,Class=14,State=1,
Activity ID: _____________.
Thanks in advance!
Client with IP address '223.196.174.128' is not allowed to access the server.
That's not an error you'll ever get from an On-Prem SQL Server. That error is coming from Azure SQL Database, and it means exactly what it says. Your client IP is not allowed to connect in the Server's Firewall.

Can't connect to Microsoft SQL Server (VM) through ODBC

I'm having an issue with the connection with the Microsoft SQL Server from VM. As I started on creating a new data source to the SQL server, the server does not recognize my SQL server and even though I did type in the server name and server IP address. Somehow I got an error that illustrates either my server does not exist or access denied.
I already had set up DCP port along with the SQL configuration, VM setting, still, I can't connect to the virtual SQL server on Oracle VM virtual box
By the way, the VM is connected to the domain
Here are several screenshots of my configuration:
In SQL Server Network Configuration manager for TCP/IP Properties on the IP Address tab for ipv4 set Enabled property to Yes. It's No in your provided screenshot.

Can't access SQL Server remotely that resides on an Azure Windows Server 2019 Virtual Machine

I have SQL Server Express installed on an Azure Windows Virtual Machine.
Steps I have taken:
updated the default port for SQL server in SQL Server Configuration Manager.
verified sql server is listening on that port (netstat -ano)
Added a Windows firewall rule to accept inbound traffic on that port (Scope of the rule limits to my static IP address)
added an inbound rule in Azure to allow access to that default port (Source IP address same as IP in Windows Firewall)
Verified Remote Connections are enabled in SSMS
Mixed authentication is enabled.
Verified user created is able to access the desired databases by logging in locally with Sql Server Management Studio. This is a sql server user and not a computer account
I am able to telnet and nc to the port.
The name of the SQL Server looks like this when i access it locally on the VM
localhost\SERVER_NAME or
hostname\SERVER_NAME
From a remote machine I am attempting to access this database using SSMS.
I have tried:
mydomain.com\SERVER_NAME -mydomain.com does resolve to the correct IP address
mydomain:1234\SERVER_NAME -1234 represents the default port that was set
I have verified the user name and password are correct. I have also tried turning off the Windows firewall which leads me to believe it might be the inbound rule in Azure but there's really nothing special to that rule, just allows traffic to the sql server port (1234, in this example).
What am i missing?
Can you please have a look to this article, if you did not yet, and ensure that you did all the steps required? To highlight a few important steps, please ensure:
Set the connectivity to publish
Use SQL Server Configuration Manager to manually enable the TCP/IP protocol
Use the SSMS to connect to your DB and use the following server address for your VM
Hope that it helps.
The correct connection string in SSMS is
mydomain,1234\SERVER_NAME
comma before port not colon.

Unable to connect to Azure SQL Server. Getting an error "The Network path was not found"

I created an Azure SQL Server. I have set the firewall, added my IP address to the rules. I tried to log in using SQL Server Managment Studio but got the network error every time. I am using the Server Admin Login and password created while creating the SQL server. Are there any more steps required to log into the SQL Server?
Note: I also enabled port 1433 for inbound connections on my PC.
According to the error message, we should check the server name of the database.
We can select the database here, and SQL Server Managment Studio will type the server name automatically:
Another way, we can find the information via azure portal, then type the server name manually:
It seems you are using named pipes to connect to SQL database. What happens if you specify TCP/IP protocol in advanced properties tab?
Thanks Everyone for your inputs. The only issue was, the firewall was blocking the port 1433. After opening it, I could connect to the SQL Server hosted in Azure. The link below mentions the requirement to open the said port. https://learn.microsoft.com/en-us/azure/sql-database/sql-database-develop-direct-route-ports-adonet-v12

sql replication using remote server

PI'm trying to do replicate two data bases.
DB in LAN network (Publisher)
DB in virtual dedicated network (Subscriber)
According to my situation, replicate publisher implemented in my server in LAN network.But subscriber is implementing on a virtual dedicated server. i configured router port to my server machine in LAN network.using sql management studio on virtual server, i connected to the db in LAN network.But when i try to create subscriber using virtual server db i can't access to the publisher.(IN LAN network.) it gives errors as below.
"SQL Server replication requires the actual server name to make a connection to the server. Connections through a server alias, IP address, or any other alternate name are not supported. Specify the actual server name, 'BESTLIFE\BESTLIFECROWN'. (Replication.Utilities)"
Please help me to solve this .
You didn't say whether you used the GUI or scripts, but somewhere, a call got made to one of the stored procedures (likely sp_addsubscription) with a server name that doesn't match the actual server name. For instance, the error message above says that the server is called BESTLIFE\BESTLIFECROWN. If that's not the name of the server that you put in as hosting the subscriber, it's not going to work. Whether you need to add a DNS alias or whatever, that's the only value that will work for this setup.

Resources