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

Quickly solve the problem of slow Tomcat startup, super simple

Today I helped a classmate solve a problem - Tomc...

How to backup and restore the mysql database if it is too large

Command: mysqlhotcopy This command will lock the ...

CSS element hiding principle and display:none and visibility:hidden

1. CSS element hiding <br />In CSS, there ar...

How to reset the root password of Mysql in Windows if you forget it

My machine environment: Windows 2008 R2 MySQL 5.6...

A useful mobile scrolling plugin BetterScroll

Table of contents Make scrolling smoother BetterS...

Share 20 excellent web form design cases

Sophie Hardach Clyde Quay Wharf 37 East Soapbox Rx...

Comprehensive summary of MYSQL tables

Table of contents 1. Create a table 1.1. Basic sy...

Solve the problem of MySql8.0 checking transaction isolation level error

Table of contents MySql8.0 View transaction isola...

Detailed explanation of JS variable storage deep copy and shallow copy

Table of contents Variable type and storage space...

A screenshot demo based on canvas in html

Written at the beginning I remember seeing a shar...

How to run the react project on WeChat official account

Table of contents 1. Use the a tag to preview or ...

Web design tips on form input boxes

1. Dashed box when cancel button is pressed <br...

Detailed tutorial on deploying apollo with docker

1. Introduction I won’t go into details about apo...

Linux implements the source code of the number guessing game

A simple Linux guessing game source code Game rul...

MySQL 5.7.18 Green Edition Download and Installation Tutorial

This article records the detailed process of down...