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

Using zabbix to monitor the ogg process (Windows platform)

This article introduces how to monitor the ogg pr...

CSS to achieve chat bubble effect

1. Rendering JD Effect Simulation Effect 2. Princ...

MySql implements page query function

First of all, we need to make it clear why we use...

CentOS 6.4 MySQL 5.7.18 installation and configuration method graphic tutorial

The specific steps of installing mysql5.7.18 unde...

How to install docker on centos

Here we only introduce the relatively simple inst...

Let's talk about the issue of passing parameters to React onClick

Background In a list like the one below, clicking...

Three ways to implement animation in CSS3

This is a test of the interviewee's basic kno...

A problem with MySQL 5.5 deployment

MySQL deployment Currently, the company deploys M...

Detailed explanation of Linux system directories sys, tmp, usr, var!

The growth path from a Linux novice to a Linux ma...

Vue implements tree table through element tree control

Table of contents Implementation effect diagram I...

Getting Started with Nginx Reverse Proxy

Table of contents Overview The role of reverse pr...

Nginx proxy forwarding implementation code uploaded by Alibaba Cloud OSS

Preface Because the mini program upload requires ...