Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connect to RDS MySQL instance from ec2 Linux AMI - mysql command not found

I try to connect to my RDS MySQL instance from an SSH connection to my ec2 server (through PUTTY) as outlined here: http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ConnectToInstance.html#USER_ConnectToInstance.CLI

But I get:

-bash: mysql: command not found

I think maybe I have to install the MySQL Utility client on my ec2 linux server? If this is the case how do I do this?

I try to run the mysql command from my /home/ec2-user directory.

like image 568
theyuv Avatar asked Dec 03 '15 11:12

theyuv


People also ask

How do I connect EC2 instance to RDS?

To connect to a private RDS DB instance from a local machine using an EC2 instance as a jump server, follow these steps: Launch and configure your EC2 instance and configure the network setting of the instance. Configure the RDS DB instance's security groups. Connect to the RDS DB instance from your local machine.


1 Answers

When using Amazon Linux 2 AMI, we need to install mysql. Use this command to install mysql on the instance:

sudo yum install mysql

And then you can connect using this command:

mysql -h change-to-your-rds-endpoint.rds.amazonaws.com -u <USER> -p
like image 169
Arif Hossain Avatar answered Sep 25 '22 10:09

Arif Hossain