Home >Database >Mysql Tutorial >centos installation mysql rpm installation

centos installation mysql rpm installation

王林
王林Original
2023-05-11 19:01:06592browse

CentOS is an operating system based on the Linux kernel and is widely used in various scenarios such as servers, virtualization and cloud platforms. MySQL is a popular open source relational database management system with good performance, stability and scalability. This article will introduce the process of installing MySQL using rpm packages in CentOS.

  1. Download the MySQL rpm package

Download the corresponding version of the MySQL rpm package from the official website. You can use the wget command or download it in the browser. This article takes the CentOS 7 system as an example. The download address is:

wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm

  1. Install the MySQL rpm package

Execute the following command to install the MySQL rpm package:

yum localinstall mysql57-community-release-el7-11.noarch.rpm

If a dependency error occurs, you can use the following command to solve it:

yum --enablerepo=extras install epel-release
yum update
yum localinstall mysql57-community-release-el7-11 .noarch.rpm

  1. Install MySQL server

Use the yum package manager to install the MySQL server:

yum install mysql-server

  1. Start the MySQL service

Use the following command to start the MySQL service:

systemctl start mysqld

  1. Set MySQL to start automatically after booting

Use the following command to set the MySQL service to start automatically at boot:

systemctl enable mysqld

  1. Configure MySQL security

Execute the following command , Configure MySQL security:

mysql_secure_installation

Follow the prompts, set the MySQL root user password, force not to use anonymous user login and delete the test database, etc.

  1. Log in to MySQL

Execute the following command to log in to MySQL:

mysql -u root -p

Enter the previously set MySQL Use the root user password to log in to the MySQL management console.

So far, we have completed the entire process of installing MySQL using rpm packages in CentOS. I hope this article can help novice developers successfully install and configure the MySQL service.

The above is the detailed content of centos installation mysql rpm installation. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn