Installing MySQL Server Community Edition
Installation Steps:
STEP 1. DOWNLOAD MYSQL 8 REPOSITORY PACKAGE
wget https://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm
STEP 2. INSTALL MYSQL REPO LOCALLY
sudo yum localinstall mysql80-community-release-el7-3.noarch.rpm
STEP 3. Import Public Key for MySQL 8
sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
STEP 4. INSTALL MYSQL SERVER
sudo yum install mysql-community-server
If you see error “conflicting requests” then follow these steps:
The reason this conflict occurs is because you installed a repository version of a repository that is not supported by Amazon Linux.
For Amazon Linux 2023, enter the command below to install the EL9 version of the repository and mysql-community-server.
sudo dnf install https://dev.mysql.com/get/mysql80-community-release-el9-1.noarch.rpm
sudo dnf install mysql-community-server
STEP 5. ENABLE MYSQL SERVICE TO AUTO-START ON REBOOT
sudo systemctl enable mysqld.service
STEP 6. START MYSQL SERVICE
sudo systemctl start mysqld.service
STEP 7. CHECK STATUS OF MYSQL SERVICE
systemctl status mysqld
Verification:
pidof mysqld
netstat -ntlp | grep 3306
sudo lsof -u mysql
Uninstall MySQL Server Community Edition:
In case if you want to uninstall MySQL Server Community Edition
sudo dnf remove mysql-community-server