Amazon has its own Linux distribution called Amazon Linux AMI. It is mostly binary compatible with Red Hat Enterprise Linux, and therefore CentOS Linux. This page explains how to install mysql client programs on Amazon Linux AMI for managing databases (RDS and Lightsail database service) in the cloud from the CLI.
Amazon Linux AMI install mysql programs using yum
The procedure is as follows:
- Update your system by running: sudo yum update
- Install mysql client on Amazon Linux AMI by typing sudo yum install mysql57
- Install existing client, run: sudo yum install mysql57
- Test your setup by connecting to RDS
Let us see all commands and examples in details.
Find mysql client on Amazon Linux AMI
Use the following yum command:
sudo yum search mysql5
sudo yum list mysql5?
Let us find out a description and summary information about package named mysql57.x86_64
sudo yum info mysql57.x86_64
sudo yum info mysql57
Sample outputs:
Available Packages Name : mysql57 Arch : x86_64 Version : 5.7.27 Release : 1.13.amzn1 Size : 14 M Repo : amzn-updates/latest Summary : MySQL client programs and shared libraries URL : http://www.mysql.com License : GPLv2 with exceptions and LGPLv2 and BSD Description : MySQL is a multi-user, multi-threaded SQL database server. MySQL is a : client/server implementation consisting of a server daemon (mysqld) : and many different client programs and libraries. The base package : contains the standard MySQL client programs and generic MySQL files.
Install MySQL client programs and shared libraries
Now you know how to search and list mysql client program. Therefore go ahead and type the following command to install the same:
sudo yum update
sudo yum install mysql57
Verify installation
Type the following command:
mysql --version
Sample outputs:
mysql Ver 14.14 Distrib 5.7.27, for Linux (x86_64) using EditLine wrapper
The syntax is s follows for connection:
mysql -u {db_user} -p -h {host_name_here} {db_name_here}
How do I connect to RDS or Lightsail database service?
Using mysql is very easy. Invoke it from the shell prompt. In this example, connect to RDS:
mysql -u {User_name} -p -h {RDS_End_Point} {DB_NAME}
mysql -u mydbuser -p -h xyz.us-east-1.rds.amazonaws.com
Where mysql command options are as follows:,
- -u : User name for login for AWS RDS cloud database server
- -p : Password to use when connecting to RDS server
- -h : Connect to given RDS host or endpoint
- {DB_NAME} : Specify RDS database name
Conclusion
You learned how to install the mysql client package using the CLI methods on Amazon Linux AMI based systems running on AWS cloud EC2 or Lightsail server. See the Amazon RDS page for more information.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
- RSS feed or Weekly email newsletter
- Share on Twitter • Facebook • 1 comment... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
Comments on this entry are closed.
Have a question or comment? Start discussion on our forum topic.