Handshake inactivity timeout coneccting to Amazon RDS Instance
I receive an error
handshake inactivity timeout when trying to connect to a newly created Amazon RDS MySql database instance.
Make sure that the security group that you have initialized with your RDS instance is correct.
By default, a default security group is selected when creating a new RDS instance. If your RDS instance is behind a firewall or other connection-limiting restriction such as behind a VPN then you won't be able to reach the RDS instance without the right security group.
The solution here is to assign the security group that allows incoming connections from your source IP address on the port designated when you created the RDS instance. The default port for MySql on RDS and MySql in general is 3306.
See also questions close to this topic
Dual database possibilities (Firebase & Webhosting service)
Is it possible to use two databases, example, Firebase and an online webhosting server? I am developing an app that uses the webhosting server for the data and the firebase only for the chats.
MYSQL How to perform custom month difference between two dates in MYSQL?
My requirement is to compute the total months and then broken months separately between 2 dates (ie first date from table and second date is current date). If broken months total count is > 15 then account it as one month experience and if its les than 15 don't account that as 1 month experience.
Assume I have a date on table as 25/11/2018 and current date is 06/01/2019; the full month in between is December, so 1 month experience; and broken months are November and January, so now I have to count the dates which is 6 days in Nov and 6 days in Jan, so 12 days and is <= (lte) 15 so total experience will be rounded to 1 month experience
I referred multiple questions related to calculating date difference in MYSQL from stackoverflow, but couldn't find any possible options. The inbuilt functions in MYSQL TIMESTAMPDIFF, TIMEDIFF, PERIOD_DIFF, DATE_DIFF are not giving my required result as their alogrithms are different from my calculation requirement.
Any clue on how to perform this calculation in MYSQL and arrive its result as part of the SQL statement will be helpful to me. Once this value is arrived, in the same SQL, that value will be validated to be within a given value range.
Including sample table structure & value:
table_name = "user" id | name | join_date --------------------- 1| Sam | 25-11-2017 2| Moe | 03-04-2017 3| Tim | 04-07-2018 4| Sal | 30-01-2017 5| Joe | 13-08-2018
I wanted to find out the users from above table whose experience is calculated in months based on the aforementioned logic. If those months are between either of following ranges, then those users are fetched for further processing.
table_name: "allowed_exp_range" starting_exp_months | end_exp_months ------------------------------------- 0 | 6 9 | 24
For ex: Sam's experience till date (10-12-2018) based on my calculation is 12+1 month = 13 months. Since 13 is between 9 & 24, Sam's record is one of the expected output.
Cannot run MySQL query, returns error cannot add or update child row.
This is the query I'm trying to run and bring in the data from the other tables.
insert into vehicleNormal (vehicleId, makeId, modelId, Year, cylinders, driveId, mpgHighway, mpgCity, fuelTypeId) (select vehicleId, makeId, modelId, Year, cylinders, driveId, mpgHighway, mpgCity, fuelTypeId from vehicle join vehicleMake on vehicleMake.vehicleMake = vehicle.make join vehicleModel on vehiclemodel.vehicleModel = vehicle.model join vehicleDrive on vehicleDrive.vehicleDrive = vehicle.drive join vehicleFuelType on vehicleFuelType.vehicleFuelType = vehicle.fuelType);
Here is the table I'm running it against.
CREATE TABLE `vehicleNormal` ( `vehicleId` int(11) unsigned NOT NULL, `makeId` int(11) DEFAULT NULL, `modelId` int(11) DEFAULT NULL, `Year` int(11) DEFAULT NULL, `cylinders` int(11) DEFAULT NULL, `driveId` int(11) DEFAULT NULL, `mpgHighway` decimal(11,0) DEFAULT NULL, `mpgCity` decimal(11,0) DEFAULT NULL, `fuelTypeId` int(11) DEFAULT NULL, PRIMARY KEY (`vehicleId`), CONSTRAINT `vehiclenormal_ibfk_1` FOREIGN KEY (`vehicleId`) REFERENCES `vehicleMake` (`makeId`), CONSTRAINT `vehiclenormal_ibfk_2` FOREIGN KEY (`vehicleId`) REFERENCES `vehicleModel` (`modelId`), CONSTRAINT `vehiclenormal_ibfk_3` FOREIGN KEY (`vehicleId`) REFERENCES `vehicleDrive` (`driveId`), CONSTRAINT `vehiclenormal_ibfk_4` FOREIGN KEY (`vehicleId`) REFERENCES `vehicleFuelType` (`fuelTypeId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Here is one of the 5 tables that I'm joining.
CREATE TABLE `vehicleMake` ( `makeId` int(11) unsigned NOT NULL AUTO_INCREMENT, `vehicleMake` varchar(50) DEFAULT NULL, PRIMARY KEY (`makeId`), UNIQUE KEY `vehicleMake` (`vehicleMake`) ) ENGINE=InnoDB AUTO_INCREMENT=191 DEFAULT CHARSET=utf8;
The other tables are exactly the same with exception of table name. They each have 2 columns (Excluding
example_1812.Vehicle) I cannot for the life of me figure out why the query that I'm attempting to run returns the error:
Cannot add or update a child row: a foreign key constraint fails (example_1812.vehiclenormal, CONSTRAINT vehiclenormal_ibfk_1 FOREIGN KEY (vehicleId) REFERENCES vehicleMake (makeId))
I'm expecting the table vehicleNormal to pull the data from the other 5 tables, 4 of which are lookup tables.
Run cron jobs in amazon web services for codeigniter function
I want to call codeigniter function for every minute in amazon web services cron jobs.How do i do it.An help will be appreciated.
Configure ssl using aws CA
I Used ACM to validate site for ssl.Instance is ec2 but domain provider is different and i have pointed domain correctly.
Then i want to issue ssl for that instance or that pointed domain.so for that i have issued ssl using Aws using DNS and then added cname records to domain record set but the issue is still
Then i come to know that we have to issue certificate using
CAand use private certificate for that.now i have some doubts:
1) what was wrong in my previous method and why its still
pending verification2) what is difference between private certificate using CA and validate aws certificate using DNS 3) if i try using Private certificate CA then it will issue me ssl for this domain and it will be secured that domain by
Any help will be appreciated.
Parse schema of a dynamic dataframe in AWS Glue
I have a dynamic dataframe in AWS glue which I created using the below piece of code.
val rawDynamicDataFrame = glueContext.getCatalogSource(database = rawDBName, tableName = rawTableName, redshiftTmpDir = "", transformationContext = "rawDynamicDataFrame").getDynamicFrame()
In order to get the schema of the above dynamic dataframe, I used the below piece of code.
val x = rawDynamicDataFrame.schema.Now x is of type
com.amazonaws.services.glue.schema.Schema.How can I parse the schema object?
Application(mumbai region) gets random timeout from read replica on mumbai : AWS RDS
My application is hosted on virginia as well as mumbai EC2 instances and we use geo based location routing for our application . Now our Prod RDS is hosted in Virginia region which has a read replica in Mumbai region. For all write operations we use Virginia region RDS and for all read actions(for mumbai region users only) we use mumbai region RDS. Now we are receiving random connection timeout errors from RDS . This can be some lag but we have set our timeout to 10000ms. Virginia region users have never reported this issue(their read/write actions point to virginia RDS only).
Any suggestion if we need to modify any setting in RDS?
Manage environment specific details using integration RDS
I want to manage client specific environment details like access id etc. in environment settings file. Each time when I require changes I need to push that in code base and go through deployment cycle. I have several environments. Now this is becoming headache for managing.
Can anyone suggest the suitable and optimal way to manage these settings via Integration RDS?
AWS Option group is not available for db instance
I created an option group in RDS in AWS for S3 Bucket for option SQLSERVER_BACKUP_RESTORE
but it is not available in DB instance as below screenshot.
Here I need option group for the DB instance to create DB backup in S3 bucket. I follow AWS document to create but it's not working for me.