How to 'switch' from MySQL to Amazon RDS with minimal application impact? - mysql

Amazon officially states: "Amazon RDS gives you access to the full capabilities of a familiar MySQL database. This means the code, applications, and tools you already use today with your existing MySQL databases work seamlessly with Amazon RDS."
I don't get this. Amazon RDS is accessible via web services and there a client libraries (like the one for .Net).
So if I have an existing .Net application that uses a DAL which in turn queries MySQL, how can I make the same DAL talk to the Amazon RDS (via the web services). Or am I missing something here?

Amazon RDS is pure MySQL, accessible by your app the same way as any other MySQL database; the web services interface to RDS is purely for creation, deletion, and modification of the DB instances, not the DB data. From their FAQ:
Q: How do I access my running DB
Instance?
Once your DB Instance is available,
you can retrieve its
endpoint via the DescribeDBInstance
API. Using this endpoint you can
construct the connection string
required to connect directly with your
DB Instance using your favorite
database tool or programming language.
In order to allow network requests to
your running DB Instance, you will
need to authorize access. For a
detailed explanation of how to
construct your connection string and
get started, please refer to our
Getting Started Guide.
This is the part of the Getting Started Guide you need -- it explains how to get the hostname of your new instance so you can connect to it, authorize the instance for access from the client, and then connect using the MySQL command-line client (as an example):
$ rds-describe-db-instances --headers
$ rds-authorize-db-security-group-ingress default --cidr-ip 192.0.2.0/30 --headers
$ mysql -h myinstance.crwjauxgijdf.us-east-1.rds.amazonaws.com -P 3306 -u mymasteruser -p

Amazon RDS is just a normal server with normal MySQL access. There's only the webservice that handles instance creation etc., but everything mysql related is still the same.

Related

Why is my MySQL Database on AWS not accessible?

I cannot reach my MySQL Database instance I created on AWS.
What I tried was to set the public access of the Database to "Publicly accessible" here:
Also I tried to set Inbound/Outbound rules for the MySQL port here:
Honestly I think using "All" ports would include 3306 too. Anyways, I tried it this way because yet it didn't work. I cannot connect to the database via MySQL Workbench, nor can I use a ping request on the given endpoint.
I would be glad if someone here has an idea what I could try else.
This will not work if you have deployed it in a private subnet which has no internet access.
Another possibility is that there is ACLs that is stopping the traffic. Security group only touch the RDS instance, the ACLs control traffic in the entire subnet.
Here is a dev AWS tutorial that creates a web application that stores data in MySQL running on the cloud. It will show you how to setup the database and the inbound rules. Once you do, you can store data or query data from MySQL. Likewise, you can use MySQL Workbench to interact with MySQL on the cloud.
AWS RDS Tutorial

How to see MongoDB hosted via AWS DocumentDB when using mongosqld on AWS EC2

Goal
I am trying to use MongoDB's BI Connector for Tableau, aka mongosqld. I have version 2.10, so here are the docs.
My long-term goal is to host mongosqld as a service on an AWS EC2 instance, and host MongoDB on AWS DocumentDB.
Background
A successful set of baby steps was:
Host MongoDB in a Docker container on my local machine via mongo image
Manually run mongosqld on my local machine, without a schema
Connect to it via mysql from my local machine
This works fine, I could see all of the databases via show databases;
My next set of steps was:
Host MongoDB in AWS DocumentDB
Host mongosqld on my EC2 instance at address 0.0.0.0:3307, without a schema
Enable TCP comms on port 3307 and 27017
Connect to it via mysql from my local machine
When I use mysql shell's show databases; command, I cannot see my databases, only information_schema and mysql.
Question
Given all of this information, does anyone here know what might have gone wrong? I am currently at a loss for what to try next.

How to take backup of MySQL database in Bluemix?

I am using IBM Bluemix MySQL database as a DB server, but I don't know how to take backup from it.
In the past I used to do that with CF tunneling option, but the new CF tool doesn't support CF tunnel.
Some services, like the experimental mysql service on Bluemix are not able to be accessed from outside of Bluemix. You can only access them from within a Bluemix cloud foundry application. If you are using this service , you will need to deploy a phpmyadmin application and bind it to that database to perform management operations.
If you are using other mysql services like cleardb, see Jeff's answer
You will need to get the connection information for the database. You can get this from the UI or the command line.
If you do this from the command line, run cf e appname. It will return the connection information for the db. You can also get it from the UI, if you click on "Show Credentials" it will give you the connection information as well.
Once you get this you can use any MySQL browser to grab the data. You can also grab it with the following command.
mysqldump [options] db_name
See this for more info.

need to connect my same apps with one database

i have 3 servers for three applications on aws ec2 using MySql database,
now each of the application is having amember that is client subscription app,
it connects with sql databse that is created in each instance
so in this way every amamber app is having diffrent database in each server,
now we are working with a device ROKU we need to pass the XML attributes from amember to it
to varify the user so he can watch online streaming tv.
the objective
now i need to make one database that will be connected with each server using amember
so each server access one database .
Options
my options are aws RDS ,dynamoDb
Now can anyone put me in the right direction, for that.
in simple Words
need to connect my multiple apps (same app) with one database
HELLLLP
If you need to connect to a mysql database, DynamoDB is not the answer. It isn't a mysql database.
RDS is a mysql database. It connects like any other mysql database. You haven't mentioned what language[s] you are using, however. Googling "connect to mysql with [language]" should help.
I think it would be best to stick with relational databases such as MySQL.
Amazon RDS is a managed MySQL solution, but you don't have to use it for your needs.
You can use one of your EC2 instances or a new EC2 instance as the central DB and connect all the other servers to it for quires. There are pros and cons for choosing RDS over your own SQL server. If you have any questions there, feel free to edit your question and add them.
EDIT according to comment
In order to connect your application with the local MySQL. Your are probably using a connection string that points to either "localhost" or "127.0.0.1"... That is the IP of your local machine. You will have to change it to the remote IP of the machine where the DB is stored remotely.

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.