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

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

Related

Throwing this error message "Error -1 - SQL connection failed." when trying to connect SQL server from Microsoft Azure's Database Migration Services

We tried to do one poc which meets our upcoming requirement in my personal Laptop. The requirement is migrating the on premise sql database into azure sql database.
The screen shot of error is,
Connection error message and description
Below are steps which we have done.
Step1:
We have created a sql database in azure portal. The server name is like sundar64599.database.windows.net
The Screenshot is here, Sql database in azure poral
Stpe2:
Then We have done the assessments and created the migration project in Data Migration Assistant tool and we deployed it successfully.
Step 3:
Then we created a Database Migration Services and tried to create a migration project.
Here we entered the source server details to connect and it throws the error as mentioned added the screenshot above.
And also we tried the below to resolve this connect issue.
1. In sql server confuguration management,
a. We restarted the sql server and tried to connect. But it fails. The screenshot is Sql server restart
b. Then we had set the TCP port as 1433 and dynamic port as 50313 and tried to connect. But it fails. The Screenshot is, Tcp with dynamic port
c. Then we had set the TCP port as 1433 and dynamic port as empty and tried to connect. But it fails. The screenshot is, Tcp empty dynamic port
2. In Sql database of azure portal, we checked the client ip and added the exact ip and tried. Even it fails. The Screenshot is, Firewall ip settings
Please add your suggestions to resolve this connection issue.
Thanks in advance,
Samidurai Tamilmani
You need to provide the FQDN (Fully Qualified Domain Name) or Public IP of the source server as described here. The way you are providing the source server will work in the local network but not from outside, which is required by the Azure Migration services.
So make sure that your source server is available from the internet. You can have a look at the complete steps here - https://learn.microsoft.com/en-us/azure/dms/tutorial-sql-server-to-azure-sql

Cannot connect Access to SQL Server Linked Tables - error message loggingin

I have a client for which I am setting up a new SQL Server Express and (on a different computer) connecting their Access front end to that SQL Server. I created an account on SQL Server, changed authentication to SQL Server. I am able to log on to that account with no issues locally (through SQL Server Management Studio) on the server itself, but when I go back to the client machine and try to create either an ODBC connection or connect directly in Linked Table manager, I get the error below. Looking at the error log in SQL Server I can see no failed logins. In Access and/or ODBC I use Servername\SQLEXPRESS, choose SQL authentication and type in the username/password that I created. But it's still being stubborn.
I'm kind of at my wits end with this one. I checked to make sure that login is enabled, that the created database is mapped to this user, but I'm out of answers. Anyone have any ideas? I'm sure it's something really stupid that I'm overlooking, I've used SQL Server for a long time but I'm not an experienced DB Administrator I'm sure it's something really simple I'm overlooking, but I've done this hundreds of times before. And Windows Authentication won't work because it's on a different computer.
To connect to a named instance on SQL Server Express with Servername\SQLEXPRESS, you need:
SQL Server Browser service running,
and its UDP port 1434 open in the firewall.
https://learn.microsoft.com/en-us/sql/sql-server/install/configure-the-windows-firewall-to-allow-sql-server-access
SQL Server Browser service
UDP port 1434
The SQL Server Browser service listens for incoming connections to a named instance and provides the client the TCP port number that corresponds to that named instance.
The fixed TCP port for your instance open in the firewall.
You set this in SQL Server Configuration Manager
https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/configure-a-server-to-listen-on-a-specific-tcp-port
This looks more like a network setting rather than server issue.
Check if all necessary permissions, configuration and settings on your machine running the server are OK to accept external connections.
Usually its the server that is rejecting the connection for security reasons.

Cannot connect to SQL Server named instance

I cannot connect to a named instance of SQL Server. I am trying to connect to domain\named_instance but this happens to all servers I try to connect to apart from localhost
The error that I cam getting looks like this:
So far I have tried:
Enabling remote connections in SQL Server
Enabling TCP/IP in the SQL Server Configuration Manager
Changing all the TCP ports in SQL Server Configuration Manager to 1433
I also tried running the command below where the number is the Process ID of the SQL Server Service:
netstat -ano | find /i “7608”
My result was as follows:
As suggested by this website.
However I do not get the ESTABLISHED return only the 2 LISTENING ones.
My IP2 IP address is set to: 192.168.2.176not 100% sure if this is right or not.
I cannot (due to security issues with my hosting company) get the IP of the server. Any and all suggestions are welcome!
I am in dire straits, and really need help!
I am using SQL Server 2008
Since you are stating you are trying to use named pipes (can be seen in the screenshots) I think you errornously trying to use TCP configuration to do this.
You need to need to enabled SQL to listen named pipes. How to do - see here.
There are multiple types of error "Cannot connect to 'Server Name'".
These error are differentiated on the basis of Error Additional Information.
One of the Solution for above error is
Connect the server using Windows Authentication.
Right Click on the Server(i.e. first option) in Object Explorer. Then go to Properties.
Go to Security then select Server Authentication as "SQL Server and Windows Authentication Mode"
Again Right Click on the Server(i.e. first option) in Object Explorer. Then select restart.
Then try again login using SQL Authentication

Unable to connect to SQL Server instance remotely

I’m trying to access the SQL Server instance on my VPS from SQL Server Management Studio on my local machine. It’s not working (the error I’m getting is:
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.
I think this is because I need to configure the database engine to allow remote connections (correct me if I’m wrong!). So I’ve found this step-by-step guide to help me do that: http://www.linglom.com/2009/03/28/enable-remote-connection-on-sql-server-2008-express/ I’ve got to point 10 in the guide and I am now stuck! I don’t have SQL Server Management Studio installed on my VPS. Anyway, this has left me with two options:
Install SSMS
Find another way to do point 10 onwards in the guide without having SSMS installed
I tried installing SSMS on my VPS using the Web Platform Installer but it keeps failing. I don’t know why it’s failing because it doesn’t seem to give a reason why. Does anyone know how I could allow remote connections a different way?
The version of SQL Server installed on my VPS is SQL Server 2008 R2 Express.
Update:
I have tried to disable the firewall on both my laptop and VPS to see if it is a firewall issue. This made no difference to the error message.
Another Update:
Having now been able to install SSMS (I installed directly from the website rather than using the WPI), I have been able to check that the server is configured to allow remote connections (I went to SSMS, connected to the SQL Server instance, right-clicked on the connection, clicked Properties, went to the Connections tab. "Allow remote connections to this server" is already ticked).
SOLUTION
Thanks to everyone for helping me get to this solution! I've finally managed to get it to work! I followed Filip De Vos's advice and opened the ports in the Firewall on my VPS and then I received a different error message. This led me to investigate further and I found that I was using the wrong credentials to login! So I've set a password for the sa user and I've managed to login using that! Thanks again!
To enable mixed authentication you can change the following registry key:
HKLM\Software\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer\LoginMode
Update the value to 2 and restart the Sql Server service to allow mixed authentication. Note that MSSQL.1 might need to be updated to reflect the number of the SQL Server Instance you are attempting to change.
A reason for connection errors can be a virus scanner installed on the server which blocks sqlserver.exe.
Another reason can be that the SQL Server Browser service is not running. When this service is not running you cannot connect on named instances (when they are using dynamic ports).
It is also possible that Sql Server is not setup to listen to TCP connections and only allows named pipes.
In the Start Menu, open Programs > Microsoft SQL Server 2008 >
Configuration Tools > SQL Server Surface Area Configuration
In the Surface Area Configuration utility, click the link "SQL Server
Configuration Manager"
Expand "SQL Server Network Configuration" and
select Protocols.
Enable TCP/IP. If you need Named Pipes, then you can
enable them here as well.
Last but not least, the Windows firewall needs to allow connections to SQL Server
Add an exception for sqlserver.exe when you use the "Dynamic Port" system.
Otherwise you can put exceptions for the SQL Server ports (default port 1433)
Also add an exception for the SQL Server Browser. (udp port 1434)
More information:
How to: Configure a Windows Firewall for Database Engine Access
Server Connectivity How-to Topics (Database Engine)
As a last note, SqlLocalDB only supports named pipes, so you can not connect to it over the network.
In addition to configuring the SQL Server Browser service in Services.msc to Automatic, and starting the service, I had to enable TCP/IP in: SQL Server Configuration Manager | SQL Server Network Configuration | Protocols for [INSTANCE NAME] | TCP/IP
Launch SQL Server Configuration Manager on your VPS.
Take a look at the SQL Server Network Configuration. Make sure that TCP/IP is enabled.
Next look at SQL Server Services. Make sure that SQL Server Browser is running.
Restart the service for your instance of SQL Server.
Open the SQL Server Configuration Manager....
2.Check wheather TCP and UDP are running or not....
3.If not running , Please enable them and also check the SQL Server Browser is running or not.If not running turn it on.....
Next you have to check which ports TCP and UDP is using. You have to open those ports from your windows firewall.....
5.Click here to see the steps to open a specific port in windows firewall....
Now SQL Server is ready to access over LAN.......
If you wan to access it remotely (over internet) , you have to do another job that is 'Port Forwarding'. You have open the ports TCP and UDP is using in SQL Server on your router. Now the configuration of routers are different. If you give me the details of your router (i. e name of the company and version ) , I can show you the steps how to forward a specific port.
I had the same issue where my firewall was configured properly, TCP/IP was enabled in SQL Server Configuration Manager but I still could not access my SQL database from outside the computer hosting it. I found the solution was SQL Server Browser was disabled by default in Services (and no option was available to enable it in SQL Server Configuration Manager).
I enabled it by Control Panel > Administrative Tools > Services then double click on SQL Server Browser. In the General tab set the startup type to Automatic using the drop down list. Then go back into SQL Server Configuration Manager and check that the SQL Server Browser is enabled. Hope this helps.
Disable the firewall and try to connect.
If that works, then enable the firewall and
Windows Defender Firewall -> Advanced Settings -> Inbound Rules(Right Click) -> New Rules -> Port -> Allow Port 1433 (Public and Private) -> Add
Do the same for Outbound Rules.
Then Try again.
I recently upgraded from SQL 2008 R2 to SQL 2012 and had a similar issue. The problem was the firewall, but more specifically the firewall rule for SQL SERVER. The custom rule was pointed to the prior version of SQL Server. Try this, open Windows Firewall>Advanced setting. Find the SQL Server Rule (it may have a custom name). Right-Click and go to properties, then Programs and Services Tab. If Programs-This program is selected, you should browse for the proper version of sqlserver.exe.
If you have more than one Instances... Then make sure the PORT Numbers of all Instances are Unique and no one's PORT Number is 1433 except Default One...
Open SQL Server Configuration Manager.
Click SQL Server Services, on the right side choose the server you've created during installation (by default its state is stopped), click once on it and a play button should appear on the toolbar. Click on this play button, wait til its state turns to "Running". Now you're good.
Open SQL Server Management Studio; switch the "Server Type" to "Database Engine" and "Authentication" to "SQL Server Authentication". The default login is "sa", and the password is the password that you chose on creating the server. Now you're good to work.
In my case the problem was caused by the inconsistency between computer names. In system settings my computer was named with some long name, but apparently the name used for some certain communications was trimmed.
I changed the name in the settings to a shorter one and it worked.
I had built both a console app and a UWP app and my console connected fine, but not my UWP. After hours of banging my head against the desk - if it's a intranet server hosting the SQL database you must enable "Private Networks (Client & Server)". It's under Package.appxmanifest and the Capabilities tab.Screenshot
Before download the last version and update your sql server to fix errors of TLS 1.2 on Sql Server 2012. For more information, check here.

establish remote connection to a SQL server instance

I am not able to establish remote connections to SQL Server 2008 enterprise edition.
I have followed and implemented a lot of tutorials available. These are the things i have done:
enabled TCP/IP connections in SQL configuration manager.
added a rule to allow inbound connections at port 1433.
allowed remote connections in the properties window of the concerned instance.
But it still gives the error
I am trying to install samples for replication using AdventuresWorks database and i am not able to install the sample.
here is the error i got
Attempting to create the 'ReplData'
share that replication uses as the
working directory.
A subdirectory or file C:\Program
Files\Microsoft SQL
Server\100\Samples\Replica
tion\ReplData already exists. The name
has already been shared.
More help is available by typing NET
HELPMSG 2118.
HResult 0x274D, Level 16, State 1 TCP
Provider: No connection could be made
because the target machine actively re
fused it.
Sqlcmd: Error: Microsoft SQL Server
Native Client 10.0 : 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.. Sqlcmd:
Error: Microsoft SQL Server Native
Client 10.0 : Login timeout expired.
The publication was created
successfully. You must create a
virtual directory to use Web
synchronization. If you plan to use a
separate Web server, you must run the
Web Synchronization Wizard on that Web
server. (A certificate that supports
SSL must already be installed.)
Do you want to create a virtual
directory named SalesOrders for Web
synchronization on S2NWORKSTATION?
[y,n]
Start the SQL Management Studio
Connect to the server.
Then choose the server in the Object-Explorer and right-click on properties.
Then check the "connections" settings, there you can/have to allow remote connections for this database server.
Are you connecting to a default instance or named instance? If a named instance, then you you should have the sql browser windows service running. Also ensure that remote connections are allowed (I believe this is a different setting than simply turning on TCP/IP).
One tool that could be helpful is PorQryUI (Port Query), it will test to see if the proper ports are open.
I too, had this problem. I solved by doing a couple of things:
1. Make sure the SQL Browser service is started on my local machine
2. Make sure UDP Port 1434 in the firewall is open for outgoing on the local machine
3. Make sure UDP Port 1434 is open in the firewall for incoming on the remote machine.
The UDP Ports are for the SQL Server Browser. Apparently, Visual Studio uses that to detect that the remote server exists.
This Stack Exchange thread was very helpful to me.

Resources