Introduction to the process of installing MySQL 8.0 in Linux environment

Introduction to the process of installing MySQL 8.0 in Linux environment

Preface

Make some notes with the help of my colleagues' notes and the pitfalls I encountered during the configuration process.

1. Linux changes the yum source (if MYSQL installation is slow, you can try it)

Introduction: Because it is the official yum, it may cause slow installation, so we switch to the domestic source.

Step 1: Enter the yum configuration file directory

cd /etc/yum.repos.d/

Step 2: Back up the configuration file (to restore it if there is a problem later):

mv means: rename

cp means: copy

mv CentOS-Base.repo CentOS-Base-yum.repo

Step 3: Download NetEase yum

wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

The downloaded file name is: CentOS6-Base-163.repo

Rename

mv CentOS6-Base-163.repo CentOS-Base.repo 

insert image description here

Step 4: Update configuration

yum update

2. Version

Version 8.0

wget http://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm

Version 5.7

wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm

3. Installation

Version 8.0

 sudo rpm -ivh mysql80-community-release-el7-3.noarch.rpm

Version 5.7

sudo rpm -ivh mysql5.7-community-release-el7-8.noarch.rpm

Install

sudo yum install mysql-server

Just keep y

insert image description here

4. View the temporary password

1. Restart the database

systemctl restart mysqld

2. View the temporary password generated by the log

grep "A temporary password" /var/log/mysqld.log 

insert image description here

3. Change the password (you will encounter pitfalls, you can see the questions at the end) to enter the database

mysql -u root -p 

insert image description here

Enter the temporary password to enter the database

Change password length

If it is root, it is 4

set global validate_password.length=4;

Modify the complexity

set global validate_password.policy=0;

The modified account and password can be consistent (if different, no configuration is required)

set global validate_password.check_user_name=off;

Revise

ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password'; 

insert image description here

Exit Database

exit

5. Configure external network access

1. Enter the database

mysql -u root -p

Enter the password to enter the database

2. Enter the MySQL database

use mysql; 

insert image description here

3. Configure access permissions

update user set host='%' where user='root';

4. Refresh permissions

flush privileges;

5. Exit the database

exit

6. Reboot

systemctl restart mysqld

6. Testing

insert image description here

7. Database Uninstallation

1. View the installed mysql

rpm -qa | grep -i mysql 

insert image description here

2. Uninstall

yum remove name 

insert image description here

3. Delete data

rm -rf /var/lib/mysql

8. Questions

Tai Chi situation

When I first entered the database, I couldn't change the password or the password length. Both sides blamed each other and played Tai Chi.

insert image description here

Solution (it means to change the password first) 1. Change the password to the generated password first

Mine is: +Eiyth9dW7ba

ALTER USER 'root'@'localhost' IDENTIFIED BY 'Generate password';

2. Modify the minimum length

Modify according to your password length

set global validate_password.length=4;

3. Modify the complexity

set global validate_password.policy=0;

4. Change password

ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';

Summarize

Make some notes with the help of my colleagues' notes and the pitfalls I encountered during the configuration process.

This is the end of this article about the process of installing MySQL 8.0 in Linux environment. For more relevant content about installing MySQL 8.0 in Linux, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Tutorial on installing mysql5.7.36 database in Linux environment
  • Detailed steps to install MySQL 8.0.27 in Linux 7.6 binary
  • Tutorial on installing MySQL under Linux
  • MySQL multi-instance deployment and installation guide under Linux
  • MySQL 8.0.25 installation and configuration tutorial under Linux
  • mysql8.0.23 linux (centos7) installation complete and detailed tutorial
  • Detailed tutorial on installing MySQL database in Linux environment
  • Detailed tutorial on installing mysql-8.0.20 under Linux
  • Linux system MySQL8.0.19 quick installation and configuration tutorial diagram
  • Tutorial on installing mysql8 on linux centos7
  • Install MySQL database in Linux environment

<<:  Talking about the use of CSS3 custom variables in projects from a project reconstruction

>>:  Solution to the garbled problem of web pages when the encoding is set to utf-8

Blog    

Recommend

How to install common components (mysql, redis) in Docker

Docker installs mysql docker search mysql Search ...

React's reconciliation algorithm Diffing algorithm strategy detailed explanation

Table of contents Algorithmic Strategy Single-nod...

A brief analysis of the difference between static and self in PHP classes

Use self:: or __CLASS__ to get a static reference...

MySQL FAQ series: When to use temporary tables

Introduction to temporary tables What is a tempor...

Nine advanced methods for deduplicating JS arrays (proven and effective)

Preface The general methods are not listed here, ...

Implementation of HTML to PDF screenshot saving function

Using Technology itext.jar: Convert byte file inp...

50 Super Handy Tools for Web Designers

Being a web designer is not easy. Not only do you...

Detailed explanation of Nginx passively checking the server's survival status

introduce Monitors the health of HTTP servers in ...

Centos7.5 installs mysql5.7.24 binary package deployment

1. Environmental preparation: Operating system: C...

The difference between mysql outer join and inner join query

The syntax for an outer join is as follows: SELEC...

javascript:void(0) meaning and usage examples

Introduction to void keyword First of all, the vo...