AWS RDS Instance is not connecting to Jmeter - sql-server

I am trying to connect my RDS instance to a Jmeter load test however no matter what I try, I keep getting this error message in the Results Tree:
Cannot create PoolableConnectionFactory (The connection to the host database-1.cqdkrfikhe1t.us-east-1.rds.amazonaws.com, named instance database-1 failed. Error: "java.net.SocketTimeoutException: Receive timed out". Verify the server and instance names and check that no firewall is blocking UDP traffic to port 1434. For SQL Server 2005 or later, verify that the SQL Server Browser Service is running on the host.)
I feel it may be a problem with my Database URL in JDBC Connection Configuration.
The picture below shows the summary report.
I have mainly tried rewriting the Database URL multiple different ways but none of them seem to work. I have also tried removing and reinstalling the JDBC Drivers but that doesn't seem to work either. I have absolutely no idea what the problem could be. Could someone please help me out with this problem?
Edit: When I change the Database URL I sometimes get this error
message as well:
Cannot create PoolableConnectionFactory (The driver could not establish a secure connection to SQL Server by using Secure Sockets
Layer (SSL) encryption. Error: "PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to
find valid certification path to requested target".
ClientConnectionId:9b700d73-f3f0-4cf6-b3a4-607fa9827219)

I think you need to use port 1433
Check out Connecting to a DB instance running the Microsoft SQL Server database engine article
So cross check the port number, VPC options, public accessibility, etc. with the values from the JDBC Connection Configuration
More information: The Real Secret to Building a Database Test Plan With JMeter

Related

Rider with SQL Server - The driver could not establish a secure connection to SQL Server by using SSL encryption

I installed SQL2019 and SQL Server Management Studio.
SQL Server with name "TESTINSTANCE" is running.
When I press "Test Connection" then I get this error:
[08S01] The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target". ClientConnectionId:9d6e6b90-bd20-4364-b0e4-bfbdd6bc57c8 unable to find valid certification path to requested target.
It seems like my solution would be tab SSH/SSL -> Use SSL, but I don't know where should I get certificate files. Maybe it's something else, I don't know.
UPDATE:
All my first attempts was without "Use SSL", it doesn't work either.
Jdbc driver is installed by Rider by default.
Server=LEKRET\TESTINSTANCE don't work (Incorrect driver and/or database URL specified).
UPDATE 2:
Well, I finally found where I can enable Trust Server Certificate, in Advanced Options. Not ideal, but everything is on local machine so it should be fine.
Password and login didn't work, but I finally managed to create login with windows auth in SSMS.
After 8 hours it's finally working.

Where can I manage TLS settings on GCloud?

I have a server (A) hosted on GCloud VM instance which points to an SQL database (B) also hosted on GCloud. Within the program on server A there is a JDBC connector used to access and edit info on server B. Recently after restarting server A, the connector records the following error:
com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "The server selected protocol version TLS10 is not accepted by client preferences [TLS13, TLS12]".
The SQL instance (B) is set to 'allow unsecure connections'.
If anyone could help me solve this error message I will appreciate it greatly.
I am very new to all of these things, so it would be great if you could be very descriptive with any responses.

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

JDBC connection fails

I am trying to connect AWS Glue to an Azure SQL Server via JDBC. I have tried different settings for the jdbc url without success. The URL's look as follows:
jdbc:sqlserver://domain.windows.net:1433/database
jdbc:sqlserver://domain.windows.net:1433;databaseName=database
In the documentation of AWS the SQL Server syntax is jdbc:sqlserver://host:port;databaseName=db_name
For test purposes I have used Squirrel SQL and made a succesful connection to my Azure SQL Server with it.
When I try to make a test connection within AWS Glue AWS CloudWatch gives me following log:
Attempting to connect with SSL: jdbc:sqlserver://domain.windows.net:1433;database={database}
SSL connection to data store failed. Retrying without SSL.
Check that your connection definition references your JDBC database with correct URL syntax, username, and password. The TCP/IP connection to the host domain.windows.net, port 1433 has failed. Error: "Connection timed out: no further information. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".
What seems strange for me are the '{' brackets in the connection. Azure's Connection String tells me, that the connection itself should look like:
jdbc:sqlserver://domain.windows.net:1433;database=database
Maybe this is the issue but I am not sure how to solve it.
As you could connect successfully to Azure SQL from squirrel; things are good on Azure end.
One issue can be SSL; But most probably it is not because it is retrying without SSL also which also failed.
On Glue end; please see if you have outbound connections allowed on that port.
you have to set outbound and inbound rule of security group which you have defined during JDBC connection. set outbound rule to all trafic allowed. also allowed tcp traffic in your azure database.

Cannot connect to SQL Server, error: 0 - No Connection could be made because the target machine actively refused it

I'm new to SQL related matters so please bare with my lack of knowledge and asking a question which has been asked countless times before.
I have to connect to a SQL database server which is located at a remote location at xxx.xx.xxx.xx:3306, but every time I try to connect I get the same 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: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)"
I get this same error whether I try to connect using SQL Server Management Studio or in a C# program via:
SqlConnection myConnection = new SqlConnection(...)
myConnection.Open();
I've tried it on two different computers, both on the same home network. I've had a look at the SQL server configuration manager on the computer which I installed SQL Server on, enabling TCP/IP and fiddling with the port values settings, but I'm guessing this is just for configuring an SQL server on my computer and irrelevant to connecting to a remote one. I shouldn't even need to install SQL server to do queries on a remote server anyway, right?
I've turned off my Windows firewall and my router firewall, though ShieldsUP still says
Port: 3306
Status: Stealth
Your system has achieved a perfect "TruStealth" rating. Not a single packet — solicited or otherwise — was received from your system as a result of our security probing tests. Your system ignored and refused to reply to repeated Pings (ICMP Echo Requests). From the standpoint of the passing probes of any hacker, this machine does not exist on the Internet. Some questionable personal security systems expose their users by attempting to "counter-probe the prober", thus revealing themselves. But your system wisely remained silent in every way. Very nice.
I read that this is irrelevant as well, since I'm not the one hosting the server, but when I was given the address, I was given the port as well, so I must have to do something with it. I'm just not sure what. My understanding of ports really is quite shaky.
I've been trying this for over a day now, and I can't think of anything more I can do.
EDIT: I fixed the problem. I had to use MySQL, not MSSQL. Doh. Sorry guys.
If you are sure the remote SQL Server is running on port 3306 (otherwise I'm not sure why you talked in the question about that port specifically), try the following connection string:
user id=username; password=password;
data source=123.45.678.90,3306;
initial catalog=dbname;
Network Library=dbmssocn;
I think without the port you'll have trouble if the other end has disabled the SQL Browser service. You should also make sure it isn't a named instance, in which case you may need:
user id=username; password=password;
data source=123.45.678.90\InstaneName,3306;
initial catalog=dbname;
Network Library=dbmssocn;
First of all the database is local or distant ?
The you have to ensure that your connection string is well written.
Here's an example of a valid connection string :
Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;
More about connection strings :
Connection Strings
Now if everything is set up correctly you have to enable remote connections to SQL Server on the host. To do so please refer to this article :
Enable SQL Server Remote Connections
Just go to ypur serveices and check whether your SQL Server (MSSQLSERVER) is running.Most of the time this error happens when SQL Server (MSSQLSERVER) is stopped.
Then select it right click and click start.problem solved !!!

Resources