Diagram of the process from uninstallation to installation of MySQL 5.7.18 yum under Linux

Diagram of the process from uninstallation to installation of MySQL 5.7.18 yum under Linux

After a lot of trouble, I finally figured out the yum installation process. I wrote about binary package installation before. Here I use yum installation. The environment is the same, Centos7.2+MySQL5.7.18.

I referred to a lot of articles for each step, which will be listed one by one later. Since the machine has already been installed, I simply uninstalled it step by step and then reinstalled it.

This article uses a series of relatively copycat methods to achieve this, which is relatively easy to understand and accept for users like me who have not been in contact with Linux for a long time, such as directly downloading files under Windows and dragging them to the Linux system instead of downloading with the wget command, and directly using the editing function of the winscp editor instead of editing with the vim command.

uninstall

Operating system version

  rpm -qa | grep -i mysql
  Run the rpm -qa | grep -i mysql command to view the installed components. 

Use the yum -y remove command to uninstall the installed MySQL components. Use the following command to uninstall the components installed above.

yum -y remove mysql-community-libs-5.7.18-1.el7.x86_64
yum -y remove mysql-community-common-5.7.18-1.el7.x86_64
yum -y remove mysql-community-client-5.7.18-1.el7.x86_64
yum -y remove mysql57-community-release-el7-10.noarch
yum -y remove mysql-community-server-5.7.18-1.el7.x86_64

I won’t take more pictures, just one as an example.

Use rpm -qa | grep -i mysql again to view the installed components, which have been completely uninstalled.

whereis mysql queries the directories generated by the previous installation and removes them one by one.

Install

Download the MySQL repo source. As for what this file is used for, my personal understanding is that it automatically helps you configure the yum source of the MySQL installation component.

This file can be downloaded under Windows and then uploaded to the Linux server, or it can be downloaded directly on the Linux server and also needs to be installed.

After downloading this file, drag it to the root directory of the Linux server through winscp

The files downloaded above under Linux

Install the MySQL repo package

 rpm -ivh mysql57-community-release-el7-10.noarch.rpm 

There will be some simple prompts in the middle. After entering Y, everything will be installed automatically.

 yum install mysql-community-server 

Installation Complete

Change the initial root password

After installation, a my.cnf file will be generated under etc. Add a skip-grant-tables = 1 configuration in my.cnf to skip the initialization password verification requirement.

systemctl start mysql service

Connect to the MySQL service. Since the password requirement is skipped, enter mysql -u -p and press Enter. When prompted to enter the password, continue to press Enter to connect to MySQL.

Change MySQL Root Password

update user set authentication_string=PASSWORD('newpassword') where User='root'; 

Use this statement to modify the root user to have remote access, update user set host = '%' where user = 'root'

After restarting, you can log in and connect to MySQL using the pre-set password

The whole process is relatively simple. If you are familiar with it, it will only take a few minutes.

It doesn't take long to go through this process. It's just that I'm not familiar with it. I try it out while groping. If someone can guide me or I try it out more, it will be much easier.

You may also be interested in:
  • How to install MySQL on Ubuntu 18.04 (linux)
  • MySQL 8.0 installation tutorial under Linux
  • Detailed tutorial on the free installation version of MySQL 5.7.18 on Linux
  • MySQL 5.6.28 installation and configuration tutorial under Linux (Ubuntu)
  • Detailed tutorial on installing MySQL 5.7.17 on Oracle Linux 6.8
  • Detailed tutorial on how to install MySQL 5.7.18 in Linux (CentOS 7) using YUM
  • Install MySQL 5.7 on Ubuntu 18.04
  • Detailed tutorial on how to install mysql8.0 using Linux yum command
  • MySQL 8.0.15 installation and configuration graphic tutorial and password change under Linux
  • Complete steps to install MySQL 8.0.x on Linux

<<:  A simple way to restart QT application in embedded Linux (based on QT4.8 qws)

>>:  Vue project realizes paging effect

Recommend

The reason why MySQL uses B+ tree as its underlying data structure

We all know that the underlying data structure of...

About Docker security Docker-TLS encrypted communication issues

Table of contents 1. Security issues with Docker ...

How to build YUM in Centos7 environment

1. Enter the configuration file of the yum source...

In-depth explanation of various binary object relationships in JavaScript

Table of contents Preface Relationships between v...

CSS to achieve floating customer service effect

<div class="sideBar"> <div>...

The difference between ENTRYPOINT and CMD in Dockerfile

In the Docker system learning tutorial, we learne...

About MYSQL, you need to know the data types and operation tables

Data Types and Operations Data Table 1.1 MySQL ty...

How to implement concurrency control in JavaScript

Table of contents 1. Introduction to Concurrency ...

Pure HTML+CSS to achieve Element loading effect

This is the effect of the Element UI loading comp...

How to use CSS media query aspect-ratio less

CSS media query has a very convenient aspect rati...