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

MySQL sharding details

1. Business scenario introduction Suppose there i...

Today I encountered a very strange li a click problem and solved it myself

...It's like this, today I was going to make a...

Vue data two-way binding implementation method

Table of contents 1. Introduction 2. Code Impleme...

Tutorial on compiling and installing MySQL 5.7.17 from source code on Mac

1. Download and unzip to: /Users/xiechunping/Soft...

js native waterfall flow plug-in production

This article shares the specific code of the js n...

Solution to Docker's failure to release ports

Today I encountered a very strange situation. Aft...

Three ways to implement animation in CSS3

This is a test of the interviewee's basic kno...

A simple explanation of MySQL parallel replication

1. Background of Parallel Replication First of al...

Example of fork and mutex lock process in Linux multithreading

Table of contents Question: 1. First attempt 2. R...

Example of how to optimize MySQL insert performance

MySQL Performance Optimization MySQL performance ...

IE8 compatibility notes I encountered

1. IE8's getElementById only supports id, not ...

An article to help you thoroughly understand position calculation in js

Table of contents introduction scroll Element.scr...

Pure CSS to change the color of the picture

The css technique for changing the color of an im...