Detailed steps to install MYSQL8.0 on CentOS7.6

Detailed steps to install MYSQL8.0 on CentOS7.6

1. Generally, mariadb is installed by default in CentOS, so first check whether mariadb is installed. If it is installed, you need to uninstall mariadb first.

rpm -qa|grep mariadb
rpm -e mariadb-libs --nodeps 

insert image description here

2. Create a mysql folder in the /usr/local/directory

cd /cd usr/localmkdir mysql 

insert image description here

3. Enter the mysql folder and download mysql

cd mysqlwget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.16-2.el7.x86_64.rpm-bundle.tar 

insert image description here

4. Unzip mysql to the current directory

tar -xvf mysql-8.0.16-2.el7.x86_64.rpm-bundle.tar 

insert image description here

5. Install mysql and execute the following commands in sequence

rpm -ivh mysql-community-common-8.0.16-2.el7.x86_64.rpm --nodeps --forcerpm -ivh mysql-community-libs-8.0.16-2.el7.x86_64.rpm --nodeps --forcerpm -ivh mysql-community-client-8.0.16-2.el7.x86_64.rpm --nodeps --forcerpm -ivh mysql-community-server-8.0.16-2.el7.x86_64.rpm --nodeps --force 

insert image description here

6. Initialization and related configuration, execute the following commands in sequence

mysqld --initialize; chown mysql:mysql /var/lib/mysql -R;
systemctl start mysqld.service;systemctl enable mysqld;

If the following error message appears when executing mysqld --initialize;, first execute yum -y install numactl, and then execute mysqld --initialize;


insert image description here

If the following error message appears when executing systemctl start mysqld.service;, first execute tail -f /var/log/mysqld.log to view the error log

insert image description here

If the error log is as follows, run cd /var/lib/mysql, run rm -rf * to delete all files, and then run systemctl start mysqld.service;


insert image description here

7. View the database initialization password

cat /var/log/mysqld.log | grep password 

insert image description here

8. Log in to the database, copy and paste the initial password, the login password will not be displayed, press Enter

mysql -uroot -p 

insert image description here

9. Change password. Password needs numbers, uppercase and lowercase letters, and special symbols.

 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'xxxxx'; 

insert image description here

10. Exit MySQL, then log in again with the new password to verify whether the password has been changed successfully

exit;mysql -uroot -p 

insert image description here

11. Create a remote access user and execute the following commands in sequence

create user 'root'@'%' identified with mysql_native_password by 'xxxxx';grant all privileges on *.* to 'root'@'%' with grant option;flush privileges;

insert image description here

12. Generally, the server does not have port 3306 developed by default. You need to configure the security group in the server console.

Summarize

The above is the detailed steps for installing MYSQL8.0 on CentOS7.6 introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • Tutorial on installing MySQL 5.7.28 on CentOS 6.2 (mysql notes)
  • MySQL 8.0.16 installation and configuration tutorial under CentOS7
  • Detailed tutorial on installing mysql 8.0.13 (rpm) on Centos7
  • CentOS7 uses yum to install mysql 8.0.12
  • Detailed steps for installing and configuring MySQL 8.0 on CentOS
  • CentOS7 installation GUI interface and remote connection implementation
  • Tutorial on installing MySql5.7 in CentOS7.2 and enabling remote connection authorization
  • Reasons and solutions for being unable to remotely connect to MySQL database under CentOS7
  • How to install MySql in CentOS 8 and allow remote connections

<<:  Vue.js implements calendar function

>>:  Summary of common commands for Linux user and group management

Recommend

How to get the maximum or minimum value of a row in sql

Original data and target data Implement SQL state...

How to solve mysql error 10061

This article shares with you the solution to the ...

HTML5+CSS3 header creation example and update

Last time, we came up with two header layouts, on...

Detailed explanation of binary and varbinary data types in MySQL

Preface BINARY and VARBINARY are somewhat similar...

Example method of deploying react project on nginx

Test project: react-demo Clone your react-demo pr...

Detailed steps for deepin20 to install NVIDIA closed-source drivers

Step 1: Install the deep "graphics driver&qu...

The whole process of Vue page first load optimization

Table of contents Preface 1. Image Optimization 2...

Tomcat Server Getting Started Super Detailed Tutorial

Table of contents 1. Some concepts of Tomcat –1, ...

Tutorial on installing Odoo14 from source code on Ubuntu 18.04

Table of contents Background of this series Overv...

Solution to HTML2 canvas SVG not being recognized

There is a new feature that requires capturing a ...

Detailed analysis of mysql MDL metadata lock

Preface: When you execute a SQL statement in MySQ...

mysql 8.0.12 winx64 download and installation tutorial

MySQL 8.0.12 download and installation tutorial f...

An example of the calculation function calc in CSS in website layout

calc is a function in CSS that is used to calcula...

The core process of nodejs processing tcp connection

A few days ago, I exchanged some knowledge about ...