We will learn about “How to install MySQL 8 on CentOS 8 Linux”, we will look at the installation for MySQL 8 step by step in CentOS 8.
MySQL is the Relation Database, which is used to store the data. It Is open-source and widely used in the industries.
MySQL written in C and C++. It has also been tested to be a “fast, stable and true multi-user, multi-threaded SQL database server”.
First, we will download the MySQL 8 Community Edition installer for CentOS 8.
Now right-click on “Download” and then select “Copy link address” and move to a terminal to download the bundle of MySQL 8.
So, now we will install wget in CentOS 8 to download the MySQL Packages.
# yum install wget
The QUICK view to installing MySQL in Linux read the POST to get detailed knowledge about the installation.
Quick view to Install MySQL 8 on CentOS 8
Install MySQL 8 on CentOS 8 Step by Step
STEP 1: Download the Package of MySQL Community Edition in CentOS 8
# wget https://downloads.mysql.com/archives/get/p/23/file/mysql-8.0.25-1.el8.x86_64.rpm-bundle.tar
So, once the file has been downloaded as “mysql-8.0.25.X.X.rpm-bundle.tar” next, we have to extract the file using tar command.
STEP 2: Extract the Package of MySQL 8 on CentOS 8.
# tar -xvf mysql-8.0.25-1.el8.x86_64.rpm-bundle.tar
So, after extraction now lets install the packages using the rpm command.
STEP 3:Install the Package of MySQL 8 using rpm and yum command on CentOS 8.
So, before installing we got some dependencies error.
Let’s install the dependencies into CentOS 8
# yum install perl-Data-Dumper perl-JSON openssl-devel -y
And then use rpm command to install the MySQL 8 Package in CentOS 8.
# rpm -vih *.rpm
STEP 4: Start the service of MySQL in CentOS 8.
# systemctl start mysqld
Start the service using systemctl command and if we want to start the service at the time of booting use below command.
# systemctl enable mysqld
STEP 5: Configure MySQL in CentOS 8.
So, after that check, the “mysqld.log” in /var/log/ folder, were you will get the temporary password.
# cat /var/log/mysqld.log
We can see the logs very clearly the logs, let’s set our own password using “mysql_secure_installation”
[root@tla ~]# mysql_secure_installation
So, you can “Enter a password of your choice” but there is some policy in MySQL for the password.
- The password length should be 8 or more than that.
- There should be one special character like “@#$!”
- There should be one UPPER case letter.
- Finally, there should be one LOWER case letter.
So then it will ask to remove the anonymous user press “y” to remove.
Next, it will prompt to Disallow root login remotely? means if we want to login from the root user remotely, press y|Y or press any other key to No.
So after that, it will ask to remove the test database and reload the changes and that’s Done.
STEP 6: Check the version of installed MySQL 8 on CentOS 8.
So we can check the version with two ways, by using the –version parameter with “mysql” command.
Also, we can check the version by take login to the MySQL 8 server.
# mysql -h localhost -uUsername -pPassword
Let’s check the database after login, use “>show databases”
mysql> show databases;
So we have successfully install MySQL 8 on CentOS 8. If you want to learn Install MySQL 8 on Ubuntu 20.04.
Also we have the Install MySQL 8 on Rocky Linux. Thanks for reading the POST.