Home >Database >Mysql Tutorial >centos installation mysql rpm installation
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.
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
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
Use the yum package manager to install the MySQL server:
yum install mysql-server
Use the following command to start the MySQL service:
systemctl start mysqld
Use the following command to set the MySQL service to start automatically at boot:
systemctl enable mysqld
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.
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!