Detailed tutorial on installing mysql-8.0.20 under Linux

Detailed tutorial on installing mysql-8.0.20 under Linux

**

Install mysql-8.0.20 under Linux

**

Environment Introduction

Operating system: CentOS 7
mysql download address: https://dev.mysql.com/downloads/mysql/
Download version: https://www.jb51.net/softs/609101.html

https://www.jb51.net/softs/609101.html

Uninstall mysql

Check whether mysql has been installed, command: find / -name mysql

Insert piece description here

If installed, uninstall:

Delete the relevant directories:

insert image description here

Delete the configuration file:

insert image description here

Delete the mysql user and user group (if there is a process, kill it and then delete it)

insert image description here

Uninstall complete!

Install mysql

Put the mysql-8.0.20-linux-glibc2.12-x86_64.tar.xz package in the /usr/local/env/mysql directory and unzip it. If there is no mysql directory, create a new one.

insert image description here

Rename after decompression

insert image description here
insert image description here

Add user group: mysql, user: mysql, and add it to the mysql user group

insert image description here

The useradd -r parameter indicates that the mysql user is a system user and cannot be used to log in to the system.
The useradd -g parameter means adding the mysql user to the mysql user group.

Check libaio

insert image description here

If not installed, install it with the following command:
yum search libaio

Configure my.cnf file

insert image description here

Copy the following information into the my.cnf file

insert image description here

Create a data folder

insert image description here

Change the user and group of the mysql directory to mysql

insert image description here

Initialize mysqld and generate an initialization password

insert image description here

Set startup

Copy the mysql.server script to the resource directory and grant execution permissions:

insert image description here

Add the mysqld service to the system service and check whether it is effective:

insert image description here

The above information is effective!
Start mysqld:

insert image description here

Configuring environment variables

Open the /etc/profile configuration file and add the following content:
#mysql environment variables
PATH=$PATH:/usr/local/env/mysql/mysql/bin
export PATH

If you have JDK, modify it as follows:

insert image description here

Execute the command to make it effective:

insert image description here

Check whether the configuration is successful. The following shows that the configuration is successful.

insert image description here

Because skip-grant-tables is added to my.cnf, it is a password-free login

insert image description here

If you have a password to log in, add # before skip-grant-tables in my.cnf

To change your login password:

insert image description here
insert image description here

If an error occurs during the execution of the above command, use flush privileges; and then execute the above command again.
Stop the service and log in with a password:

insert image description here

Restart the service:

insert image description here

This is an unsuccessful connection using navicat:

insert image description here

Enable remote login:

insert image description here
insert image description here

Use navicat to connect again:

insert image description here

Connection successful!

Summarize

This is the end of this article about the detailed tutorial on installing mysql-8.0.20 under Linux. For more relevant content about installing mysql8.0.20 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
  • Introduction to the process of installing MySQL 8.0 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
  • Linux system MySQL8.0.19 quick installation and configuration tutorial diagram
  • Tutorial on installing mysql8 on linux centos7
  • Install MySQL database in Linux environment

<<:  Alibaba Cloud Server Domain Name Resolution Steps (Tutorial for Beginners)

>>:  Integration practice of Vue+Element background management framework

Recommend

How to use Vue cache function

Table of contents Cache function in vue2 Transfor...

Detailed explanation of Linux file permissions and group modification commands

In Linux, everything is a file (directories are a...

Common causes and solutions for slow MySQL SQL statements

1. Slow query due to lack of index or invalid ind...

How to compile the Linux kernel

1. Download the required kernel version 2. Upload...

MySQL graphical management tool Navicat installation steps

Table of contents Preface 1. Arrange the installa...

How to dynamically add a volume to a running Docker container

Someone asked me before whether it is possible to...

Causes and solutions for cross-domain issues in Ajax requests

Table of contents 1. How is cross-domain formed? ...

Web Design: Script Materials Reconstruct User Experience

<br />Original text: http://blog.rexsong.com...

How to install Element UI and use vector graphics in vue3.0

Here we only focus on the installation and use of...

MySQL 4 methods to import data

1. Import mysql command The mysql command import ...

jQuery implements font size adjustment case

This article shares the specific code of jQuery t...

Summary of pitfalls of using nginx as a reverse proxy for grpc

background As we all know, nginx is a high-perfor...

MySQL transaction analysis

Transaction A transaction is a basic unit of busi...