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

Recommend

How to display and format json data on html page

JSON data is displayed and formatted on the HTML ...

js canvas realizes slider verification

This article example shares the specific code of ...

Slot arrangement and usage analysis in Vue

The operating environment of this tutorial: Windo...

Html tips to make your code semantic

Html semantics seems to be a commonplace issue. G...

js to realize payment countdown and return to the home page

Payment countdown to return to the home page case...

...

Docker core and specific use of installation

1. What is Docker? (1) Docker is an open source t...

js to implement verification code interference (static)

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

Using JavaScript difference to implement a comparison tool

Preface At work, I need to count the materials su...

How to use React slots

Table of contents need Core Idea Two ways to impl...

Example of utf8mb4 collation in MySQL

Common utf8mb4 sorting rules in MySQL are: utf8mb...

Start a local Kubernetes environment using kind and Docker

introduce Have you ever spent a whole day trying ...

How to manually encapsulate paging components in Vue3.0

This article shares the specific code of the vue3...