Detailed tutorial on installing mysql 5.7.26 on centOS7.4

Detailed tutorial on installing mysql 5.7.26 on centOS7.4

MariaDB is installed by default in CentOS, which is a branch of MySQL. However, for the sake of need, MySQL still needs to be installed in the system, and MariaDB can be directly overwritten after the installation is complete.

1 Download and install the official MySQL Yum Repository

[root@localhost ~]# wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm

Use the above command to directly download the Yum Repository for installation, which is about 25KB, and then you can directly install it with yum.

[root@localhost ~]# yum -y install mysql57-community-release-el7-10.noarch.rpm

After that, start installing the MySQL server.

[root@localhost ~]# yum -y install mysql-community-server

This step may take some time, and once the installation is complete it will overwrite the previous mariadb.

2 MySQL Database Settings

First start MySQL

[root@localhost ~]# systemctl start mysqld.service

Check the running status of MySQL, as shown in the figure:

[root@localhost ~]# systemctl status mysqld.service 

At this point, MySQL has started running normally, but to enter MySQL, you must first find out the password of the root user. You can find the password in the log file using the following command:

[root@localhost ~]# grep "password" /var/log/mysqld.log 

Enter the database using the following command:

[root@localhost ~]# mysql -uroot -p

Enter the initial password. You cannot do anything at this time because MySQL requires you to change the password by default before you can operate the database:

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';

Password setting 12 digits

There is a problem here. If the new password is set too simply, an error will be reported:

The reason is that MySQL has password setting specifications, which are specifically related to the value of validate_password_policy :

Once you have set your password, you are done.

Summarize

The above is a detailed tutorial on how to install MySQL 5.7.26 on centOS7.4. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • How to install MySQL 5.7 from source code in CentOS 7 environment
  • Tutorial on installing lnmp using yum on centos7 (linux+nginx+php7.1+mysql5.7)
  • A concise tutorial on how to install mysql5.7 decompressed version on CentOS7
  • Centos7 installation and configuration of Mysql5.7
  • Install and configure MySQL 5.7 under CentOS 7
  • Detailed tutorial on installing MySQL 5.7.20 on RedHat 6.5/CentOS 6.5
  • Install MySQL 5.7.18 using rpm package under CentOS 7
  • Tutorial on installing and configuring MySql5.7 in Alibaba Cloud ECS centos6.8
  • CentOS 6.6 source code compilation and installation of MySQL 5.7.18 tutorial detailed explanation

<<:  Detailed explanation of TypeScript 2.0 marked union types

>>:  MySQL database SELECT query expression analysis

Recommend

How to set Tomcat as an automatically started service? The quickest way

Set Tomcat to automatically start the service: I ...

HTML tag full name and function introduction

Alphabetical DTD: Indicates in which XHTML 1.0 DT...

How to limit the value range of object keys in TypeScript

When we use TypeScript, we want to use the type s...

Vue3.0+vite2 implements dynamic asynchronous component lazy loading

Table of contents Create a Vite project Creating ...

Example code for implementing stacked carousel effect with HTML+CSS+JS

Effect: When the slideshow moves in one direction...

Avoiding Problems Caused by Closures in JavaScript

About let to avoid problems caused by closure Use...

Parsing the commonly used v-instructions in vue.js

Table of contents Explanation of v-text on if for...

Detailed steps for deploying Tomcat server based on IDEA

Table of contents Introduction Step 1 Step 2: Cre...

The use of MySQL triggers and what to pay attention to

Table of contents About Triggers Use of triggers ...

Summary of MySQL basic common commands

Table of contents MySQL basic common commands 1. ...

Detailed explanation of Tomcat configuration and optimization solutions

Service.xml The Server.xml configuration file is ...

CSS border adds four corners implementation code

1.html <div class="loginbody"> &l...

Implementation of Docker container state conversion

A docker container state transition diagram Secon...

Install Python 3.6 on Linux and avoid pitfalls

Installation of Python 3 1. Install dependent env...

Detailed explanation of MySQL master-slave replication and read-write separation

Table of contents Preface 1. Overview 2. Read-wri...