Pre-requisites:
A system with CentOS Stream 9 installed and running
Access to a terminal or command line
Root or sudo privileges
First update your system
dnf update -y
Add the MySQL Repository
dnf install -y https://dev.mysql.com/get/mysql80-community-release-el9-1.noarch.rpm
Install MySQL using the DNF package manager after the repository has been added
dnf install -y mysql-community-server
If you receive the following messages
Error: GPG check failed
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
Workaround: install GPG key manually. You’ll need to load the key that is not yet expired directly from a url
rpm –import https://repo.mysql.com/RPM-GPG-KEY-mysql-2023
The my.cnf is the configuration file for MySQL databases
find ‘/’ -name “my.cnf”
The -name option searches for files with a specific name
The root filesystem is represented by a forward slash (“/”)
Start the MySQL service
systemctl start mysqld.service
Enable MySQL to start on boot
systemctl enable mysqld
Secure MySQL Installation
mysql_secure_installation
Follow the prompts
Testing MySQL
mysql -u root -p
Enter the password you set. If you’re greeted by the prompt, then your mysql installation is successfully installed.
You can show your MySQL version with the following command:
mysql -V
You can check the status of the MySQL server with the following command:
systemctl status mysqld
Port 3306 is MySQL’s default port.
MySQL writes a log file. Its path is /var/log/mysqld.log, defined in the log-error config variable.
Linux supports a number of different solutions for installing MySQL.
To see a list of options provided by mysql, invoke it with the --help option:
mysql --help
Remember to keep MySQL up to date for the latest security features, performance enhancements, and bug fixes.
For more information:
https://dev.mysql.com/doc/refman/8.0/en/linux-installation.html
https://dev.mysql.com/doc/refman/8.0/en/checking-rpm-signature.html
https://stackoverflow.com/questions/71239450/gpg-keys-issue-while-installing-mysql-community-server