Export an AWS Aurora Serverless MySQL database with mysqldump - mysql

Is it possible to export an AWS Aurora Serverless MySQL database with mysqldump without using an EC2 instance?

At this time you cannot gain public access to Aurora, or use a site to site VPN connection to connect to it.
Whichever resource you use will need to reside within the VPC of the Aurora Serverless cluster. Possible solutions to bypass the requirement for EC2 would be either running a Fargate container to run your command or looking at Lambda to execute the command.

I finally decided to emulate mysqldump using Python and the AWS Data API.
To emulate mysqldump, I followed:
How can I dump a MySQL database without using mysqldump in Python

Related

Migrating AWS RDS to GCP (sql 5.7)

im running mysql 5.7 in my AWS RDS. I wanted to migrate the DB to my GCP without downtime.
How this can be done? Can i create a replica to GCP and use it as Master DB in GCP environement
yes, you could create a replicate to external mysql, you could find guideline as below link.
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/MySQL.Procedural.Importing.External.Repl.html
After you switch to gcp, you could still set the replicate the reverse way to aws rds mysql.
Also you could find more detailed steps in below aurora doc link. it contains the configuration for aurora, rds mysql, mysql.
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Replication.MySQL.html

From localhost to aurora serverless

I'm studying the possibility to switch from an rds mysql (in use and with tables and data inside) to aurora serverless mysql to try to spend less money because the database is used for few operations. I can connect to rds mysql from my pc (dbeaver, mysql workbench and so on) without problems and I can design tables, view data, create users...
Now, I've created the new serverless db and attached to the same vpc and sec group of the first one but I can't connect to it from my pc. I've read on aws guides that there are two solutions:
use ec2 to ssh tunnel requests --> but it's a payware solution;
use cloud9 and connect via terminal --> but organizing a db in this way is not so simple as using a gui client.
For this reasons I've quite understood that serverless is not a good solution for now.
Any idea or suggest?
Thanks in advance

Does AWS RDS support two way replication with local MySQL database?

I would like to sync the local MySQL database to Amazon RDS MySQL database. I found a solution for EC2 to RDS but not for Local Database to RDS.
I built a database including 12 tables which all I want to get backup them to cloud periodically or automatically.
I do not want to run EC2 server since I need only MySQL database to get backup on cloud.
I need a solution like Microsoft Database Sync Agent. Whenever changes detected in Local Database, it should be synced to the cloud database. How can I make this happen?
You could use the AWS Database Migration Service:
AWS Database Migration Service (AWS DMS) is a cloud service that makes it easy to migrate relational databases, data warehouses, NoSQL databases, and other types of data stores. You can use AWS DMS to migrate your data into the AWS Cloud, between on-premises instances (through an AWS Cloud setup), or between combinations of cloud and on-premises setups.
With AWS DMS, you can perform one-time migrations, and you can replicate ongoing changes to keep sources and targets in sync.
You can achieve this by following below steps.
Make a replica of local server to RDS.
Enable Query logging in local Database
Create a cron job which will process logging queries and it will execute queries on RDS instance in same order.
To generate a replica to RDS you can follow below steps.
You can't replicate your local database to RDS directly. Your need to dump you data and then after you can import it on RDS.
Instead of generating a dump file you can directly import data into RDS using below command.
mysqldump db_name | mysql -h 'other_hostname' db_name
You can find our more about this over here.
https://dev.mysql.com/doc/refman/5.7/en/copying-databases.html
Also first import tables & it's data then after import your triggers, routines & events. If you import together then there is a chances to get conflict and you job will be terminated.

AWS RDS vs MySql database directly on EC2

I created MySql database directly on EC2 instance (I host there my web app and database), I didn't set up RDS. But my database constantly keep crashing. So now I want to use RDS.
How to integrate my existing databases on EC2 with RDS?
By integrate I mean simply how to migrate them to RDS that they stop crashing on EC2 instance. Do I have to remove them from EC2, stop mysqld service on EC2 and then create them from scratch on RDS and change database access configurations in my apps or is there simpler way?
Unload your data from the SQL instance into CSVs. Put it into S3. Terminate your EC2 instance. Spin up RDS instance. Load data out of S3 into RDS. Job done.

How does one see what data is stored in the RDS database?

Running our app on Amazon RDS. How does one review / inspect data in the database? For example, how can I get a list of articles?
My app is running on Ruby on Rails and on Heroku. One method I thought of, is by running the Heroku console command.
Is there a better way to see what data is stored in the RDS database?
I use MySQL Workbench to view data, run queries, and so on. It connects right up to the Amazon RDS MySQL instance using the regular MySQL settings.
Updated:
Be sure to add the ip address of the computer for which you're connecting to the RDS instance to the access list in RDS. IIRC, by default RDS instances will only accept connections from within AWS.
I was using SequelPro but they don't support ssl. Amazon RDS says something to the effect of having to use SSH to connect your EC2 to your RDS.
This is essentially what was done in the following tutorial which uses MySQL Workbench: http://thoughtsandideas.wordpress.com/2012/05/17/monitoring-and-managing-amazon-rds-databases-using-mysql-workbench/
I had also been using SequelPro before but this tutorial is very clear and I was up and running on MySQL Workbench in just a few minutes.