Thomas Step

<- Blog

Interested in learning more about serverless AWS? Check out my Guide to Building with Serverless AWS (only pay what you want)

Installing the MySQL CLI on an EC2 Instance

The other day I spun up an RDS cluster in a VPC and wanted to connect to it to make sure everything looked correctly configured. However, since I put the cluster in a private subnet and only allowed connections from the VPC, I was not able to connect from my desktop. The solution I decided to go for was spinning up a small EC2 instance, SSHing into the EC2 instance, and connecting to my database through the CLI. Unfortunately, the default AMI does not come with the mysql CLI installed. Here is how I installed it.

$ sudo yum install -y
$ sudo yum install -y mysql-community-client
$ mysql -u MY_USER -p`MY_PASSWORD` -h MY_HOST -P 3306
mysql> show databases;

After installing and connecting to my database, I was able to confirm that everything was up an running.

Categories: aws | ops | databases