Its a bit strange. Until yesterday I was able to connect to all of my SQL Servers. Once I restarted my computer, a new firewall seems to have been unexpectedly added. I tried to sign in to my azure account, but I am still getting the same error.
I have had a similar problem myself in the past, and trying to configure firewall settings through SQL Server Management Studio could not solve it for me. Instead I did this:
Log into Microsoft Azure
Go to your SQL Server that you are having difficulties with
From the menu, select "Firewalls and Virtual Networks"
Select "Add Client IP"
Enter your public IP address.
There is also documentation here
Related
I have a user with SSMS installed locally who wants to be able to access the SQL Db on a remote server over SonicWall SSL VPN.
He can connect to the VPN just fine, RDP to SQL server (as a test) just fine, but cannot connect with SSMS to the server.
So far I've tried:
Enabling Trust for the connection as it was at first presenting an SSL error. Now we just get "login failed for user" errors.
Tested his user with Windows Authentication on the server directly, it works fine.
Enabling names pipes and TCP/IP in server configuration manager.
Testing logging in with a SQL authentication user over VPN - This also works fine.
I am sure the domain\username and password are correct and verified them in several other ways.
Checked the SQL server properties and Allow remote connections is enabled with no timeout.
Opened up everything in the sonicwall from the SSLVPN to the SQL server as a test, changed nothing.
Attempted disabling the local and SQL windows firewall, changed nothing.
Probably some other stuff, but I don't remember right now.
This is SQL Server 2014. He is using SSMS 2017, but I've tried it on the SQL Server with 2017 and it works fine and as mentioned he can log in over VPN with a direct SQL Server user. All other users just RDP to SQL server and connect that way so this has never come up again, but they don't want the new employee having RDP access to the SQL Server.
The exact settings on his SSMS I'm using are Active Directory - Password and under connection properties encrypt connect and trust server certificate are checked.
No special or changed ports on SQL Server, everything is basic installation defaults.
In this example, I'm editing the NT Service\MSSQLSERVER user.
However, when you edit the user/s in question and navigate to User Mapping as can be seen below:
Is the Database they are allowed to access selected?
Also, while the Database is selected, did you tick the permissions to the Database, as stipulated above?
If not, please try this and advise if it worked?
I'm trying to connect to a SQL Server database that's being hosted on Azure, I'm using the server explorer to select my Azure account, then the SQL Server; I right click and select "Open in SQL Server Object Explorer" after which I'm prompted to enter the password.
I'm unable to go past this step as I've been getting this error (see screenshot) ever since creating the server. I've added my IP address to the SQL Server's firewall.
I've even tried connecting to it with my firewall off but I get the same error.
I managed to fix the problem, it turns out the network(eduroam) at my university was the problem. I don’t understand how or why they’d want to block Azure; but using a proxy or a mobile hotspot connects me immediately without any errors.
Thanks you all for trying to help.
You can open Visual Studio from within Azure Portal and you will be automatically connected to your Azure databases. Please see image below.
You need to get your IPv4 address by pulling up Command Prompt and typing in ipconfig. Then go to your azure database and configure the firewall settings. Next add a client by creating a new client name and adding the IP address you got from your computer. This will allow your computer to access your database. It also lets you create a range for your IP address which I recommend doing.
This may look like a repeat of an already existing question but it isn't.
I am trying to work with an Azure-SQL database. I attempted to log in both from Visual Studio and SQL Server Management Studio and I get the following error:
Now, after some basic troubleshooting I made sure that the firewall in the server had my IP recorded, so that isn't the issue here.
Also, just for trying I did a mobile hotspot from my phone and it logged in with no issues. So for some reason my home network isn't letting me work this.
Now before I reached out to my ISP (which would be hell on earth) I did some more digging and found this: https://stackoverflow.com/a/38641107/6461236
That users suggests that the solution is to go into "SQL Server Configuration Manager" and modify port permissions. But when I attempt to find this, it's not in my PC. I have a Windows 10 PC and I have searched everywhere and I just can't find this SQL Server Configuration Manager. Check out what I get on my Computer Management window:
So the bottom line is that I have installed both Visual Studio 2017 and SQL Server Management Studio 2017 and my computer doesn't have a SQL Server Configuration Manager. After researching a bit more all that I have found is that it should be there.
What did I miss? How can I solve this pesky problem? Thanks in advance!
EDIT: Since I could log in with no issues with my phone as a hotspot and the issues only present themselves when using my home WiFi it seems that this is a problem with my home network and not with my PC or Azure. Any tips? Should a phone call to my ISP solve this?
The issue was that my network firewall was set to "max" and was therefore blocking any outbound traffic on port 1433 (which is necessary to connect to SQL Azure). The solution was to modify the router firewall to allow for communication on this port to be outbound.
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
Today I get this strange exception:
Error HRESULT E_FAIL has been returned from a call to a COM component. (mscorlib)
I cannot connect to my database! Tool started under admin rights.
Services:
I am not sure if disabling firewall is enough. if the user has sysadmin permissions and still getting this error means client is not able to connect to server in debugging mode. check this TCP and UDP ports are correctly open.
SQL remote debugging configuration
EDIT:1
I am sure you must have also googled a lot and tried to find out about the error messages. What I have found so far is the Error in the OP you mentioned is misleading and from that error, we cannot tell what exactly is wrong or what to look next. But as you replied in the comments, after making changes to enable Remote Debugger; the mentioned error is more clear and I feel that proper permission is still an issue. Plenty of other suggestion you also might have tried so far, but if you haven’t done this, let's try one more time:
In one of the comments, I mentioned you to try login using the windows user.
Now Keep the settings you already did for TCP ports, Firewall Exception etc… explained in the above link. you have windows 2012 server where you installed DB server. and windows 8 Prof where you have DB client and you connecting through SSMS. Now I believe both machines are in the same domain. Let’s say domain XYZ. You must have windows login on the server, let’s say it is “XYZ\HALI” using which you can login to the Windows Server. log in and make sure that login also exists in SQL SERVER with sysadmin permission. Because client machine is also in same domain make sure you have logged in into the client machine using same user “XYZ\HALI”. Now start SSMS and choose windows authentication instead of SQL SERVER authentication. Try to start Debugging T-SQL code now.
if client and server machines are not in same domain then we have to register server name on client machine as Linked Server, impersonate the login/user as local and then try the debugging.
Edit:2
Login to SSMS using Windows Authentication