Detailed steps for installing and configuring MySQL 8.0 on CentOS

Detailed steps for installing and configuring MySQL 8.0 on CentOS

Preface

Here are the steps to install and configure MySQL on CentOS;

text

Download the installation package from the yum source

yum localinstall https://repo.mysql.com//mysql80-community-release-el7-1.noarch.rpm

Install

yum install mysql-community-server

Start the service

service mysqld start

View Status

service mysqld status 

這里寫圖片描述

View initial password

grep 'temporary password' /var/log/mysqld.log 

這里寫圖片描述

Login Change Password

mysql -uroot -p

The password is the one found above.

Then enter the command flush privileges

Enter the mysql database use mysql;

Change Password

ALTER USER 'root'@'localhost' IDENTIFIED BY 'your password';

At this point, the installation and configuration on the server has been completed. However, when you connect remotely, you find that the connection is not successful. The reason may be that the server port 3306 is not open to the outside world; the database user does not have remote connection login permissions;

Configure MySQL to allow external access

Enter the mysql database use mysql

Modify the user table of the mysql database and change the host item from localhost to %. %This means that any host is allowed to access. If only a certain IP is allowed to access, you can change it to the corresponding IP.

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH PRIVILEGES;

Test the remote connection again and the connection is successful.

Summarize

The above are the steps for installing and configuring MySQL 8.0 on CentOS 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!

You may also be interested in:
  • Detailed steps to install MYSQL8.0 on CentOS7.6
  • 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
  • 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

<<:  Detailed explanation of Linux curl form login or submission and cookie usage

>>:  How to understand JS function anti-shake and function throttling

Recommend

Native js to implement a simple calculator

This article example shares the specific code of ...

In-depth analysis of the role of HTML <!--...--> comment tags

When we check the source code of many websites, w...

13 Most Frequently Asked Vue Modifiers in Interviews

Table of contents 1. lazy 2.trim 3.number 4.stop ...

Detailed example of using case statement in MySQL stored procedure

This article uses an example to illustrate the us...

Solve the problem of VScode configuration remote debugging Linux program

Let's take a look at the problem of VScode re...

Vue Beginner's Guide: Creating the First Vue-cli Scaffolding Program

1. Vue--The first vue-cli program The development...

Description of the default transaction isolation level of mysql and oracle

1. Transaction characteristics (ACID) (1) Atomici...

MySQL 8.0.18 stable version released! Hash Join is here as expected

MySQL 8.0.18 stable version (GA) was officially r...

Sample code for implementing radar chart with vue+antv

1. Download Dependency npm install @antv/data-set...

Detailed explanation of various ways to merge javascript objects

Table of contents Various ways to merge objects (...

How to implement web page compression in Nginx optimization service

Configure web page compression to save resources ...

Execute the shell or program inside the Docker container on the host

In order to avoid repeatedly entering the Docker ...

What to do if you forget your mysql password

Solution to forgetting MySQL password: [root@loca...