Install MySQL Community Server on CentOS 7

By default, if you run the command “yum install mysql-server” on CentOS 7, it will install you MariaDB server, a database system similar to MySQL. If you still want to use MySQL Server, please refer to this tutorial. I will guide you how to install MySQL Server Community version on CentOS 7 in this tutorial!

– First, you need to go to the address https://dev.mysql.com/downloads/repo/yum/ to download the latest version of MySQL Community Server for CentOS 7.

Currently, the latest version of MySQL is version 8.x. The file I will download is https://repo.mysql.com//mysql80-community-release-el7-3.noarch.rpm.

– After the download is complete, please use the rpm tool to install the file:

– Update CentOS repository

-At this point, we can install the MySQL Community Server:

Result:

Install MySQL Community Server on CentOS 7

By default, after the installation is completed, SQL Server has not been started. To start it up, please run the following command:

Check status:

Result:

Install MySQL Community Server on CentOS 7

During the installation process, you can see, there is no option for us to set the password for the root user. The reason is that the password for the root user has been generated by default in the MySQL log file. You can check this password information by running the following command:

My results are as follows:

Install MySQL Community Server on CentOS 7

To change this default password, run the following command:

Result:

At this point, you can start using MySQL server:

Install MySQL Community Server on CentOS 7

Add Comment