Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Detailed process of installing MySQL8.0.26 under CentOS7

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly explains the "detailed process of installing MySQL8.0.26 under CentOS7". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "the detailed process of installing MySQL8.0.26 under CentOS7".

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

2. Use xftp to upload the compressed package to a folder on the virtual machine or server, and finally extract the MySQL package to a custom directory. If you download this step in Linux, skip this step (no restrictions).

3. To uninstall the mariadb database, first check the installation package of mariadb, then uninstall it, and finally check and confirm it again. The command is as follows:

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

4. Decompress the uploaded mysql installation package, and extract the command format: tar-xvf * *, as I unzip to / software/mysql directory, as follows:

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

5. Then install the options in the following list, and the rest can be ignored:

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-forcerpm-ivh mysql-community-libs-8.0.26-1.el7.x86_64.rpm-- nodeps-forcerpm-ivh mysql-community-client-8.0.26-1.el7.x86_64.rpm-nodeps-- forcerpm-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-- initializechown mysql:mysql / var/lib/mysql-Rsystemctl start mysqld.servicesystemctl enable mysqld

8. To view the initial password of the database, the command is as follows:

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

9. Log in to mysql using the root user and enter the initial password

Mysql-u root-p

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

Alter user "root" @ "localhost" identified by 1qaz@2wsx

Authorization for remote access through the following command

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

12. Modify the encryption rules with the following command. The MySql8.0 version is different from the 5.0 encryption rules, but the current visualization tools only support the old encryption methods, and finally refresh the modified permissions.

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

13. Close firewall with the following command

Systemctl stop firewalld.servicesystemctl disable firewalld.servicesystemctl mask firewalld.service

14. Install iptables Firewall, appear and complete! Or Complete! To be successful, the command is as follows:

Yum-y install iptables-services

15. Start and set up the firewall with the following command

Systemctl enable iptables;systemctl start iptables

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

Vi / etc/sysconfig/iptables

-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 80-j ACCEPT

-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 3306-j ACCEPT

-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 443-j ACCEPT

-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 8080-j ACCEPT

-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 8090-j ACCEPT

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

Systemctl restart iptables.service

18. Set the firewall to boot by command:

Systemctl enable iptables.service

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

Thank you for your reading, these are the contents of "the detailed process of installing MySQL8.0.26 under CentOS7". After the study of this article, I believe you have a deeper understanding of the detailed process of installing MySQL8.0.26 under CentOS7, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report