CentOS7 uses yum to install mysql 8.0.12

CentOS7 uses yum to install mysql 8.0.12

This article shares the detailed steps of installing MySQL 8.0.12 using yum on centos7 for your reference. The specific contents are as follows

Clean up the original mysql

rpm -qa | grep mysql
#The possible display is as follows#mysql-community-libs-8.0.12-1.el7.x86_64
#mysql80-community-release-el7-1.noarch
#mysql-community-client-8.0.12-1.el7.x86_64
#mysql-community-common-8.0.12-1.el7.x86_64
#mysql-community-server-8.0.12-1.el7.x86_64
#Delete through the following command yum remove mysql-xxx-xxx-


#Find the relevant files of mysql find / -name mysql

#Delete the mysql configuration file information according to your needs rm -rf /var/lib/mysql

Delete the default database mariadb of CentOS7

rpm -qa | grep mariadb
#Find mariadb
#Possible results mariadb-libs-5.5.56-2.el7.x86_64
#Forcefully delete the search results rpm -e --nodeps mariadb-libs-5.5.56-2.el7.x86_64

Download mysql yum source

mysql yum source download address

Click download to enter the download page

Hover the mouse over "No thanks, just start my download." to view the address of the mysql yum source, right-click and copy the link address to download

cd /usr/src
wget https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm

#Install yum source yum localinstall mysql80-community-release-el7-1.noarch.rpm

#Update yum source yum clean all
yum makecache

#Start installing MySQL
yum install mysql-community-server

#Start MySQL
systemctl start mysqld

#After successful startup, you can view the randomly generated initialization password cat /var/log/mysqld.log | grep password

#Log in to MySQL and modify the mysql user password mysql -u root -p
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'yourpassword';
#Remotely set mysql> use mysql;
mysql> update user set host='%' where user='root';
#Authorize the user name's permissions and grant any host the permission to access data mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;

Other ways to set MySQL user permissions

#Allow myuser to connect to the mysql server from any host using the mypassword password GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%'IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
#Allow user myuser to connect to the MySQL server from the host with IP 192.168.1.6 and use mypassword as the password GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3'IDENTIFIED BY 'mypassword' WITH GRANT OPTION;

Database related operations

#Start mysql
systemctl start mysqld.service

#End systemctl stop mysqld.service

#Restart systemctl restart mysqld.service

#Start automatically at boot time systemctl enable mysqld.service

After the mysql login user password is set, you need to develop the security group port

After the port is opened, you can connect to the database. When using Navicat for MySQL to connect to MySQL 8.0.12, there may be problems such as Client does not support authentication protocol error solution

#Modify the encryption rules (I didn't write this line, but it seems to be OK) The password needs to be set to a format that contains uppercase and lowercase letters and numbers, otherwise the setting will not be successful ALTER USER 'root'@'%' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER; 
#Update the user's password ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password'; 
#Flush permissions FLUSH PRIVILEGES;

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

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
  • 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 element implements table adding, deleting and modifying data

>>:  Django online deployment method of Apache

Recommend

Detailed explanation of docker nginx container startup and mounting to local

First, the structure inside the nginx container: ...

Learn javascript iterator

Table of contents Introduction What does an itera...

Implementation of Docker cross-host network (overlay)

1. Docker cross-host communication Docker cross-h...

Detailed explanation of publicPath usage in Webpack

Table of contents output output.path output.publi...

JS ES6 asynchronous solution

Table of contents Initially using the callback fu...

Explanation of the process of docker packaging node project

As a backend programmer, sometimes I have to tink...

Differences in the hr separator between browsers

When making a web page, you sometimes use a dividi...

JavaScript Basics Variables

Table of contents 1. Variable Overview 1.1 Storag...

Summary of Spring Boot Docker packaging tools

Table of contents Spring Boot Docker spring-boot-...

React Fragment Introduction and Detailed Usage

Table of contents Preface Motivation for Fragment...

Solution to nacos not being able to connect to mysql

reason The mysql version that nacos's pom dep...

mysql delete multi-table connection deletion function

Deleting a single table: DELETE FROM tableName WH...

Docker Compose practice and summary

Docker Compose can realize the orchestration of D...

js implements single click to modify the table

Pure js implements a single-click editable table ...

WeChat applet implements a simple dice game

This article shares the specific code of the WeCh...