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

Explanation on whether to choose paging or loading in interactive design

The author of this article @子木yoyo posted it on hi...

Summary of horizontal scrolling website design

Horizontal scrolling isn’t appropriate in all situ...

Python 3.7 installation tutorial for MacBook

The detailed process of installing python3.7.0 on...

React Routing Link Configuration Details

1. Link's to attribute (1) Place the routing ...

How to use Linux commands in IDEA

Compared with Windows system, Linux system provid...

Detailed explanation of scheduled tasks and delayed tasks under Linux

at at + time at 17:23 at> touch /mnt/file{1..9...

Summary of MySQL stored procedure permission issues

MySQL stored procedures, yes, look like very rare...

Detailed steps to install MySql 5.7.21 in Linux

Preface The most widely used database in Linux is...

React implements paging effect

This article shares the specific code for React t...

How to use mysqldump for full and point-in-time backups

Mysqldump is used for logical backup in MySQL. Al...

Detailed explanation of how two Node.js processes communicate

Table of contents Preface Communication between t...

ftp remotely connect to Linux via SSH

First install ssh in Linux, taking centos as an e...

Detailed explanation of MySQL 5.7.9 shutdown syntax example

mysql-5.7.9 finally provides shutdown syntax: Pre...