The process of installing MySQL 8.0.26 on CentOS7

The process of installing MySQL 8.0.26 on CentOS7

1. First, download the corresponding database from the MySQL official website according to your machine: https://dev.mysql.com/downloads/mysql/

2. Use xftp to upload the compressed package to a folder on the virtual machine or server, and finally decompress the MySQL compressed package to a custom directory. If you download it on Linux, skip this step (the method is not limited).

3. Uninstall the mariadb database. First check the mariadb installation package, then uninstall it, and finally check it again to confirm. The command is as follows:

rpm -qa | grep mariadb
rpm -e mariadb-libs-5.5.68-1.el7.x86_64 --nodeps

4. Unzip the uploaded MySQL installation package. The decompression command format is: tar -xvf **. For example, I unzipped it to the /software/mysql directory, as shown below:

tar -xvf mysql-8.0.26-1.el7.x86_64.rpm-bundle.tar 

5. Then install the options in the following list and ignore the rest:

mysql-community-common
mysql-community-libs
mysql-community-client
mysql-community-server

The command is as follows:

rpm -ivh mysql-community-common-8.0.26-1.el7.x86_64.rpm --nodeps –force
rpm -ivh mysql-community-libs-8.0.26-1.el7.x86_64.rpm --nodeps –force
rpm -ivh mysql-community-client-8.0.26-1.el7.x86_64.rpm --nodeps --force
rpm -ivh mysql-community-server-8.0.26-1.el7.x86_64.rpm --nodeps --force

The implementation is as follows:

6. View the installed MySQL resources

rpm -qa | grep mysql 

7. Enter the following command to complete the initialization and related configuration of MySQL

mysqld --initialize
chown mysql:mysql /var/lib/mysql -R
systemctl start mysqld.service
systemctl enable mysqld

8. View the initial password of the database. The command is as follows:

cat /var/log/mysqld.log | grep password

9. Log in to MySQL as root user and enter the initial password

mysql -u root -p 

10. Change the root password, then exit to verify the password. The command is as follows:

alter user "root"@"localhost" identified by 1qaz@2wsx;

11. Authorize remote access through the following command

create user 'root'@'%' identified with mysql_native_password by '1qaz@2wsx'; 
grant all privileges on *.* to 'root'@'%' with grant option;
flush privileges; -- effective immediately 

12. Modify the encryption rules through the following command. The encryption rules of MySql8.0 and 5.0 are different, and the current visualization tool only supports the old encryption method. Finally, refresh the modified permissions.

ALTER USER 'root'@'localhost' IDENTIFIED BY '1qaz@2wsx' PASSWORD EXPIRE NEVER;
flush privileges;

13. Turn off the firewall through the following command

systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl mask firewalld.service 

14. Install the iptables firewall. If "Complete!" or "Complete!" appears, it means success. The command is as follows:

yum -y install iptables-services

15. Start the firewall with the following command

systemctl enable iptables;
systemctl start iptables;

16. Edit the firewall through the vi /etc/sysconfig/iptables command and add a port

vi /etc/sysconfig/iptables

-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8090 -j ACCEPT

17. Restart the firewall with the following command to make the configuration take effect:

systemctl restart iptables.service

18. Set the firewall to start at boot time through the command:

systemctl enable iptables.service

19. Finally, use the client tool to connect and test.

This is the end of this article about installing MySQL 8.0.26 on CentOS 7. For more information about installing MySQL 8.0.26 on CentOS 7, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • MySQL 8.0.26 installation and configuration method graphic tutorial
  • MySQL offline installation 8.0.26 graphic tutorial
  • MySQL-8.0.26 Configuration Graphics Tutorial
  • MySQL 8.0.26 installation and simplified tutorial (the most complete on the Internet)
  • Complete step-by-step record of MySQL 8.0.26 installation and uninstallation
  • MySQL 8.0.28 installation and uninstallation tutorial in Ubuntu 20
  • Ubuntu MySQL 8.0.28 installation and configuration method graphic tutorial
  • Windows free installation MySQL 8.0.28 version graphic tutorial
  • mysql 8.0.28 winx64.zip installation and configuration method graphic tutorial
  • MySQL 8.0.26 installation and configuration graphic tutorial

<<:  Summary of the differences between global objects in nodejs and browsers

>>:  5 cool and practical HTML tags and attributes introduction

Recommend

Summary of MySQL LOAD_FILE() function method

In MySQL, the LOAD_FILE() function reads a file a...

MySQL 5.7.21 Installer Installation Graphic Tutorial under Windows 10

Install MySQL and keep a note. I don’t know if it...

js implements random roll call

This article shares the specific code of js to im...

mysql backup script and keep it for 7 days

Script requirements: Back up the MySQL database e...

Tutorial on how to install and use Ceph distributed software under Linux

Table of contents Preface 1. Basic Environment 1....

Detailed explanation of Docker data backup and recovery process

The data backup operation is very easy. Execute t...

CSS inheritance method

Given a div with the following background image: ...

How to use lazy loading in react to reduce the first screen loading time

Table of contents use Install How to use it in ro...

Are you still Select *?

There are many reasons why an application is as s...

Detailed installation tutorial of Mysql5.7.19 under Centos7

1. Download Download mysql-5.7.19-linux-glibc2.12...

Analyze the problem of pulling down the Oracle 11g image configuration in Docker

1. Pull the image docker pull registry.cn-hangzho...