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 explanation of the tutorials for installing Mysql8.0.19 in CentOS7.5

2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

I. Preface

There is no screenshot in the mysql installation section of this article, so it is suitable for students who have a certain foundation.

The installation method is to download the tar file through the official website of mysql, and install the rpm file after decompression.

Because the corporate network is slow, when installing using the yum method, it is often impossible to download half of the files, so use this method. As long as the tar file is there, you can copy it to wherever you want to install it (please ignore the students with good Internet speed).

Second, download the installation file

Open the address: https://www.mysql.com, click the red box link:

At the end of the page, click the red box link:

On the open page, click the red box link:

Select this on the open page (CentOS is based on Red Hat, so choose like this), and then download:

The mysql version downloaded is: 8.0.19

3. CentOS7 installation Mysql operation

Linux version

The version of CentOS7 is 7.5.1804

Clean-up work

1. Use the rpm-qa | grep mariadb command to view the installation package of mariadb

two。 If you have any information, uninstall it with the rpm-e-- nodeps mariadb-libs-x.x.xx-x.xxx.x86_64 command

3. Use the rpm-qa | grep mysql command to view the installation package of mysql

4. If you have any information, delete it in turn through the yum remove mysql-community-*** command

5. Find the mysql configuration file through the find /-name mysql command

6. If you have any information, delete it in turn by using the rm-rf file path command

Initialize directory

1. Enter the virtual machine

two。 Create a mysql folder by calling the mkdir / usr/local/mysql command

3. Upload the mysql installation file downloaded above to the / usr/local/mysql directory

Students with ideas can put them in other catalogs.

Start the installer

1. Use the tar-xvf mysql-8.0.19-1.el7.x86_64.rpm-bundle.tar command to extract the tar package.

two。 Install common with the command rpm-ivh-- nodeps-- force mysql-community-common-8.0.19-1.el7.x86_64.rpm.

3. Install libs with the command rpm-ivh-- nodeps-- force mysql-community-libs-8.0.19-1.el7.x86_64.rpm.

4. Install client with the command rpm-ivh-- nodeps-- force mysql-community-client-8.0.19-1.el7.x86_64.rpm.

5. Install server with the command rpm-ivh-- nodeps-- force mysql-community-server-8.0.19-1.el7.x86_64.rpm.

6. Use the rpm-qa | grep mysql command to view the installation package of mysql. If you have the above four messages, you are successful.

7. Complete the initialization and related configuration of the mysql database with the following command:

Enter the mysqld-- initialize command and enter.

Enter the chown mysql:mysql / var/lib/mysql-R command and enter.

Enter the systemctl start mysqld.service command and enter.

Enter the systemctl status mysqld.service command, enter, and the green word indicates that the service starts successfully.

Enter the systemctl enable mysqld command and enter.

8. Use the cat / var/log/mysqld.log | grep password command to view the database password and copy it.

9. Enter and enter the database login interface through the mysql-uroot-p command.

10. Paste the password you just found, log in to the database, and the login password for mysql is not displayed.

11. Use the alter user 'root' @' localhost' identified with mysql_native_password by 'root'; command to change the password.

twelve。 Exit mysql with the exit command, and then log in again with the new password root.

13. Grant remote access:

Enter the create user 'root'@'%' identified by' root'; command and enter.

Enter the grant all privileges on *. * to 'root'@'%'; command and enter.

Enter the flush privileges; command and enter.

14. Modify the remote authorization password through the alter user 'root' @'% 'identified with mysql_native_password by' root'; command so that client tools can connect.

15.。 Exit mysql with the exit command and open firewall port 3306 with the / sbin/iptables-I INPUT-p tcp-- dport 3306-j ACCEPT command.

16. At this point, you can use client tools (such as Navicat, SQLyog, etc.) to connect to mysql.

IV. matters needing attention

The above steps may differ due to problems with the mysql or virtual machine version.

Please be sure to use the large versions introduced in the article: CentOS7.5 and Mysql8.0.

Summary

The above is the detailed explanation of the CentOS7.5 installation Mysql8.0.19 tutorial introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave a message for me, and the editor will reply you in time. Thank you very much for your support to the website! If you think this article is helpful to you, you are welcome to reprint it, please indicate the source, thank you!

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

Database

Wechat

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

12
Report