Unlock the power of relational databases and streamline your data management processes by discovering how to easily install MySQL on CentOS – a must-know skill
In this step-by-step guide, we will show you how to install MySQL 8.0 on RHEL 9 or CentOS 9, ensuring a smooth setup for your database needs.
In the dynamic landscape of database management systems, MySQL continues to be a popular choice for many developers and businesses alike. With the release of MySQL 8.0, users can benefit from enhanced security features, improved performance, and a host of new functionalities.
Follow these steps to install MySQL8.0 on your RHEL9 or CentOS9 OS.
Before you begin the installation process, it’s essential to ensure that your system is up-to-date. Run the following commands in your terminal:
$ sudo dnf update
This will update your system’s package repositories and install any available updates.
MySQL 8.0 is not included in the default repositories of RHEL 9 or CentOS 9. You need to download the MySQL repository package from the official MySQL Yum repository. Use the following commands to download and install the repository package:
$ sudo dnf install https://dev.mysql.com/get/mysql80-community-release-el9-1.noarch.rpm
NOTE: The mysql80-community-release-el9-1.noarch.rpm
is the latest available version as of the date of this publication. Check the MySQL Community Downloads page to ensure you have the latest version.
Once the repository package is installed, enable the MySQL 8.0 repository with the following command:
$ sudo dnf module enable mysql:8.0
Now, you can install MySQL 8.0 using the following command:
$ sudo dnf install mysql-server
As shown below, the MySQL8.0 package and its dependencies will be installed.
Photo by admingeek from Infotechys
Start the MySQL service and enable it to start on boot:
$ sudo systemctl start mysqld
$ sudo systemctl enable mysqld
You can also use the --now
flag to execute the two commands above at once.
$ sudo systemctl enable --now mysqld
MySQL provides a script to secure your installation. Run the following command and follow the on-screen prompts to enhance the security of your MySQL server:
$ sudo mysql_secure_installation
Regular Backups: Ensure regular backups of your MySQL databases to prevent data loss in case of unexpected events.
Use Strong Passwords: Set strong and unique passwords for MySQL users to enhance security.
Update Regularly: Keep MySQL and your operating system up-to-date with the latest security patches and improvements.
Monitor Performance: Utilize MySQL monitoring tools to track performance metrics and identify potential issues.
Firewall Configuration: Configure your firewall to allow traffic on the MySQL port (default is 3306) and restrict access to authorized IP addresses.
By following these step-by-step instructions and incorporating best practices, you can seamlessly install MySQL 8.0 on RHEL 9 or CentOS 9. Stay ahead in the realm of database management by taking advantage of the latest features and security enhancements offered by MySQL 8.0.
Was this article helpful to you? If so, let us know in the comments. We appreciate your feedback!
Related Posts
Unlock the power of relational databases and streamline your data management processes by discovering how to easily install MySQL on CentOS – a must-know skill
Are you looking to set up MySQL on your RHEL 9 or CentOS 9 server? Follow these detailed steps to install MySQL on RHEL 9 or
In this step-by-step guide, we will show you how to install mariaDB on CentOS7. MariaDB is a fork of MySQL relational database management systems (RDBMS). Table