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

Example of stars for CSS rating effect

What? What star coat? Well, let’s look at the pic...

Detailed explanation of JavaScript Reduce

Table of contents map filter some every findIndex...

Nginx cache configuration example

When developing and debugging a web application, ...

Summary of MySQL foreign key constraints and table relationships

Table of contents Foreign Key How to determine ta...

JSONP cross-domain simulation Baidu search

Table of contents 1. What is JSONP 2. JSONP cross...

How to use node to implement static file caching

Table of contents cache Cache location classifica...

Do designers need to learn to code?

Often, after a web design is completed, the desig...

Detailed explanation of the mechanism and implementation of accept lock in Nginx

Preface nginx uses a multi-process model. When a ...

HTML Grammar Encyclopedia_HTML Language Grammar Encyclopedia (Must Read)

Volume Label, Property Name, Description 002 <...

VS2019 connects to mysql8.0 database tutorial with pictures and text

1. First, prepare VS2019 and MySQL database. Both...

Example code for achieving hollowing effect with pure CSS

I have recently studied the hollowing effect. bac...

How to build a new image based on an existing image in Docker

Building new images from existing images is done ...