Tutorial on installing MySQL 5.7.9 using RPM package under CentOS 7

Tutorial on installing MySQL 5.7.9 using RPM package under CentOS 7

Recorded MySQL 5.7.9 installation tutorial, share with everyone

Environment Introduction:

Operating system: Centos 7.1

MySQL database version: mysql5.7.9

MySQL official website: http://www.mysql.com

1. Before installing the new version of MySQL, we need to uninstall the mariadb-lib that comes with the system

[root@5201351 ~]# rpm -qa|grep mariadb
mariadb-libs-5.5.41-2.el7_0.x86_64
[root@5201351 ~]# rpm -e mariadb-libs-5.5.41-2.el7_0.x86_64 --nodeps

2. Go to the official website of MySQL and download the latest version of MySQL rpm collection package: mysql-5.7.9-1.el7.x86_64.rpm-bundle.tar

3. Upload mysql-5.7.9-1.el7.x86_64.rpm-bundle.tar to the Linux server and decompress the tar package

4. The simplest way to install the mysql-server service is to install the following four packages. We can use the rpm -ivh command to install them.

mysql-community-common-5.7.9-1.el7.x86_64.rpm
mysql-community-libs-5.7.9-1.el7.x86_64.rpm -- (depends on common)
mysql-community-client-5.7.9-1.el7.x86_64.rpm -- (depends on libs)
mysql-community-server-5.7.9-1.el7.x86_64.rpm -- (depends on client, common)

5. Next is to initialize the database. We can use the following commands, and the effects are the same.

[root@5201351 ~]# mysql_install_db --datadir=/var/lib/mysql 
//Datadir must be specified. After execution, the ~/.mysql_secret password file will be generated [root@5201351 ~]# mysqld --initialize      
//This method is recommended for the new version. The execution will generate a random password in /var/log/mysqld.log

6. Change the user and group of the MySQL database directory, and then start the MySQL database

[root@5201351 ~]# chown mysql:mysql /var/lib/mysql -R
[root@5201351 ~]# systemctl start mysqld.service //Start the mysql database service

7. Log in to MySQL according to the password in step 5 and change the password of the root user. The new version of MySQL cannot execute any commands before changing the password after the first login.

[root@5201351 ~]# mysql -uroot -p')j#)=uRig4yJ'
mysql> set password=password('www.cnblogs.com/5201351');

8. Finally, we can also create users and assign permissions according to actual conditions.

mysql> create user 'root'@'192.168.100.2' identified by 'QQ5201351'; 
mysql> GRANT ALL PRIVILEGES ON dbname.* to 'root'@'192.168.100.2';
mysql> flush privileges

Finally, one thing that needs special attention is that there is no Password field in the user table under the new version of MySQL database.

Instead, the encrypted user password is stored in the authentication_string field

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:
  • CentOS7 uses rpm to install MySQL 5.7 tutorial diagram
  • Detailed tutorial on installing mysql 8.0.13 (rpm) on Centos7
  • Installation tutorial of mysql8.0rpm on centos7
  • Solution to the initialization error when installing mysql5.7 from rpm package in centos6.5
  • Install MySQL 5.7.18 using rpm package under CentOS 7
  • Alibaba Cloud Centos7.3 installation mysql5.7.18 rpm installation tutorial
  • CentOS7 uses rpm package to install mysql 5.7.18
  • Install mysql5.7.13 using RPM in CentOS 7
  • CentOS7 detailed installation of MySQL using rpm
  • Brief analysis of centos 7 mysql-8.0.19-1.el7.x86_64.rpm-bundle.tar

<<:  Detailed explanation of routing parameter passing and cross-component parameter passing in Vue

>>:  vue cli3 implements the steps of packaging by environment

Recommend

Simple example of using Docker container

Table of contents 1. Pull the image 2. Run the im...

In-depth understanding of the role of Vuex

Table of contents Overview How to share data betw...

Example of using Nginx reverse proxy to go-fastdfs

background go-fastdfs is a distributed file syste...

TypeScript union types, intersection types and type guards

Table of contents 1. Union Type 2. Crossover Type...

How to implement form validation in Vue

1. Installation and use First, install it in your...

An example of how Tomcat manages Session

Learned ConcurrentHashMap but don’t know how to a...

Example analysis of mysql stored procedure usage

This article describes the usage of MySQL stored ...

Web Design Tutorial (4): About Materials and Expressions

<br />Previous Web Design Tutorial: Web Desi...

SSM VUE Axios Detailed Explanation

Table of contents How to display SQL log? ? Descr...

It's the end of the year, is your MySQL password safe?

Preface: It’s the end of the year, isn’t it time ...

MySQL executes commands for external sql script files

Table of contents 1. Create a sql script file con...

Docker+nacos+seata1.3.0 installation and usage configuration tutorial

I spent a day on it before this. Although Seata i...

Introduction and use of five controllers in K8S

Table of contents Controller type of k8s Relation...