CentOS7.5 installation of MySQL8.0.19 tutorial detailed instructions

CentOS7.5 installation of MySQL8.0.19 tutorial detailed instructions

1. Introduction

This article does not have screenshots for the MySQL installation part, so it is suitable for students with a certain foundation.

The installation method is to download the tar file from the MySQL official website, unzip it and install the rpm file.

Because the company network is slow, when using the yum method to install, the file often fails to download halfway, so this method is used. As long as the tar file is there, you can copy it anywhere to install it (please ignore this if you have a good internet connection).

2. Download the installation file

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

Scroll to the end of the page and click the red box link:

On the page that opens, click the red box link:

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

The downloaded mysql version is: 8.0.19

3. CentOS7 installation of Mysql operation

Linux version

The version of CentOS7 is: 7.5.1804

Cleaning up

1. Check the installation package of mariadb through rpm -qa | grep mariadb command

2. If there is information, uninstall it through rpm -e --nodeps mariadb-libs-xxxx-x.xxx.x86_64 command

3. Check the mysql installation package through rpm -qa | grep mysql command

4. If there is information, delete it one by one through the yum remove mysql-community-*** command

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

6. If there is information, delete it one by one through the rm -rf file path command

Initialize the directory

1. Enter the virtual machine

2. Create the mysql folder by commanding mkdir /usr/local/mysql

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

Students with ideas can put it in other directories

Start the installation process

1. Unzip the tarball using the tar -xvf mysql-8.0.19-1.el7.x86_64.rpm-bundle.tar command.

2. Install common through the rpm -ivh --nodeps --force mysql-community-common-8.0.19-1.el7.x86_64.rpm command.

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

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

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

6. Check the mysql installation package through the rpm -qa | grep mysql command. If the above four information are available, it indicates success.

7. Complete the initialization and related configuration of the MySQL database through the following commands:

Enter the mysqld --initialize command and press Enter.

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

Enter the systemctl start mysqld.service command and press Enter.

Enter the systemctl status mysqld.service command and press Enter. Green text indicates that the service has been started successfully.

Enter the systemctl enable mysqld command and press Enter.

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

9. Use the mysql -uroot -p command and press Enter to enter the database login interface.

10. Paste the password you just found and log in to the database. The MySQL login password is not displayed.

11.Change the password by using the alter user 'root' @'localhost' identified with mysql_native_password by 'root'; command.

12. Exit mysql using the exit command, and then log in again using the new password root.

13. Grant remote access permission:

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

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

Enter the flush privileges; command and press Enter.

14. Use the alter user 'root' @'%' identified with mysql_native_password by 'root'; command to change the remote authorization password so that the client tool can connect.

15. Exit mysql using the exit command and open firewall port 3306 using 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. Precautions

Due to MySQL or virtual machine version issues, the above steps may be slightly different.

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

Summarize

The above is the detailed graphic tutorial of installing MySQL 8.0.19 on CentOS 7.5 introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • CentOS7.5 uses mysql_multi to install MySQL5.7.28 multiple instances (detailed explanation)
  • Centos7.5 installs mysql5.7.24 binary package deployment
  • CentOS7.5 installation tutorial of MySQL

<<:  Create a code example of zabbix monitoring system based on Dockerfile

>>:  jQuery achieves full screen scrolling effect

Recommend

Summary of the data storage structure of the nginx http module

Starting from this section, we will explain the i...

Special commands in MySql database query

First: Installation of MySQL Download the MySQL s...

Detailed explanation of this pointing problem in JavaScript function

this keyword Which object calls the function, and...

Introduction to the use and disabling of transparent huge pages in Linux

introduction As computing needs continue to grow,...

Optimal web page width and its compatible implementation method

1. When designing a web page, determining the widt...

Summary of React's way of creating components

Table of contents 1. Create components using func...

How to ensure the overall user experience

Related Articles: Website Design for User Experien...

A complete example of implementing a timed crawler with Nodejs

Table of contents Cause of the incident Use Node ...

Two ways to specify the character set of the html page

1. Two ways to specify the character set of the h...

Implementation of MySQL index-based stress testing

1. Simulate database data 1-1 Create database and...

JavaScript to achieve a simple carousel effect

What is a carousel? Carousel: In a module or wind...

How to use the Clipboard API in JS

Table of contents 1. Document.execCommand() metho...

How to change the Ali source in Ubuntu 20.04

Note that this article does not simply teach you ...

Tutorial on installing Microsoft TrueType fonts on Ubuntu-based distributions

If you open some Microsoft documents with LibreOf...