Get the App
SLTechnology News&Howtos  ›  Database  › 

Centos7's method of installing mysql through yum

Shulou Source: shulou.com Published: 2022-06-01 04:04:02 11月24日 Update

1. Check to see if mysql is installed

Yum list installed | grep mysql

If there is, uninstall it all.

Yum-y remove + database name

2.MySQL depends on libaio, so install libaio first

Yum search libaio # retrieve related information yum install libaio # install dependency package

3. Download MySQL Yum Repository

If the wget command cannot be found, yum install wget first.

Wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

4. Add MySQL Yum Repository

Add MySQL Yum Repository to your system repository list and execute

Yum localinstall mysql-community-release-el7-5.noarch.rpm

5. Verify whether the addition is successful.

Yum repolist enabled | grep "mysql.*-community.*"

6. Select to enable the MySQL version

View the MySQL version, execute

Yum repolist all | grep mysql

You can see that version 5.5 and 5.7 is disabled by default, because the latest stable version is 5.6.

Yum repolist enabled | grep mysql

View the current startup version of MySQL

7. Install MySQL through Yum

Yum install mysql-community-server

Yum automatically handles dependencies between MySQL and other components

At this point, the MySQL installation is complete, and it contains four packages: mysql-community-server, mysql-community-client, mysql-community-common, and mysql-community-libs.

8. Execution

Rpm-qi mysql-community-server.x86_64 0virtual 5.6.24-3.el7

If prompted that you can't find it, follow the version you installed, and then run part 7 to see the installed version.

Execution

You can see that the installation directory for MySQL is / usr/bin/

Start and shut down MySQL Server

Start MySQL Server

Systemctl start mysqld

View MySQL Server status

Systemctl status mysqld

Close MySQL Server

Systemctl stop mysqld

Test whether the installation is successful

Mysql

You can enter the mysql command line interface

Firewall settings (can be turned off directly)

To access MySQL remotely, open the default port number 3306.

Execution

Firewall-cmd-permanent-zone=public-add-port=3306/tcpfirewall-cmd-permanent-zone=public-add-port=3306/udpfirewall-cmd-reload-

Summary

The above is the editor to introduce to you the method of installing mysql through centos7 through yum. I hope it will be helpful to you. If you have any questions, please leave a message for me. The editor will reply you in time!

Tags: Version success command method information slogan name data database status interface question directory system component firewall security processing help open Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi OPPO Reno Redmi Shulou Technology Shulou Tech Info