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

Several ways to schedule backup of MySQL database (comprehensive)

Table of contents 1. mysqldump command to back up...

An article to deal with Mysql date and time functions

Table of contents Preface 1. Get the current time...

Detailed tutorial on installing centos8 on VMware

CentOS official website address https://www.cento...

Example of how to configure the MySQL database timeout setting

Table of contents Preface 1. JDBC timeout setting...

Vue Element front-end application development table list display

1. List query interface effect Before introducing...

How to encapsulate query components based on element-ui step by step

Table of contents Function Basic query functions ...

Difference between MySQL update set and and

Table of contents Problem Description Cause Analy...

Bootstrap 3.0 study notes grid system case

Preface In the previous article, we mainly learne...

How to implement Svelte's Defer Transition in Vue

I recently watched Rich Harris's <Rethinki...

How to convert rows to columns in MySQL

MySQL row to column operation The so-called row-t...

Summary of pitfalls in importing ova files into vmware

Source of the problem As we all know, all network...

Is mysql a relational database?

MySQL is a relational database management system....

Discussion on the browsing design method of web page content

<br />For an article on a content page, if t...