Detailed tutorial on how to install MySQL 5.7.18 in Linux (CentOS 7) using YUM

Detailed tutorial on how to install MySQL 5.7.18 in Linux (CentOS 7) using YUM

The project needs to use MySQL. Since I had always installed it in a fool-proof manner under Windows before, I basically didn't encounter any problems. However, this time I had to install it on the server. Since I was not familiar with installing software on Linux, I took a lot of detours and wasted a lot of time. Summarize it so as to avoid taking the same detour next time.

****************************The picture insertion failed, I don't know what happened*************************************

1. Various environments:

Linux version: CentOS Linux release 7.2.1511 (core)

MySQL version: community server 5.7.18

The yum installation package used:

Red Hat Enterprise Linux 7 / Oracle Linux 7 (Architecture Independent), RPM Package 25.1K 
Download
(mysql57-community-release-el7-11.noarch.rpm)

2. Installation steps

I first downloaded the installation package on Windows, and then imported it into the server through xshell. Then install it according to the steps on the MySQL official website. No tutorial is as reliable as the one on the official website. I have searched for many tutorials on the Internet before, and the installation method of each tutorial is different, which made me very depressed, and none of them were successful. Finally, I successfully installed it through the tutorial on the official website.

2.1 Select Installation Guide

2.2 Click to enter and select the universal binary version. installing MySQL on Unix/Linux Using Generic Binaries

2.3 Just follow the above steps step by step.

shell> yum search libaio # search for info (Mysql installation depends on the libaio library, so you need to install the libaio library first)
shell> yum install libaio # install library
shell> groupadd mysql
shell> useradd -r -g mysql -s /bin/false mysql
shell> cd /usr/local
shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
shell> mkdir mysql-files
shell> chmod 750 mysql-files
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> bin/mysql_install_db --user=mysql # MySQL 5.7.5 (use this command for MySQL 5.7.5. If your MySQL is 5.7.6 or above, you do not need to execute this command)
shell> bin/mysqld --initialize --user=mysql # MySQL 5.7.6 and up
shell> bin/mysql_ssl_rsa_setup # MySQL 5.7.6 and up
shell> chown -R root .
shell> chown -R mysql data mysql-files
shell> bin/mysqld_safe --user=mysql &
# Next command is optional
shell> cp support-files/mysql.server /etc/init.d/mysql.server

After completing all the above steps, the installation is complete.

2.4 After the installation is complete, start the mysql service

[root@***** /]# cd ~ #There is a problem here. I don’t know if I need to switch to the “~” directory. There was no “~” before, and the startup failed. I’m not sure if I entered the sytemctl start mysqld.service command incorrectly or for other reasons.
[root@******** ~]# systemctl start mysqld.service

Check whether the startup is successful

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

If this flag is present, the startup is successful

2.5 Get the temporary password during installation to log in to MySQL

grep'temporary
 password'/var/log/mysqld.log
2017-05-10T00:55:46.982233Z
 1 [Note] A temporary password is generated for root@localhost: 5C::+lMjqi+z

The one in the red box is a temporary password.

2.5 Log in using a temporary password

[root@****** ~]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.18

2.6 Change Password

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'newpassword';
Query OK, 0 rows affected (0.00 sec)

Note: The latest MySQL has very high requirements for security. The password must contain special characters, uppercase and lowercase letters, and numbers. Otherwise, the change will fail and an error will be reported.

ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

The above is a detailed tutorial on how to install MySQL 5.7.18 under Linux (CentOS 7) using YUM. 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!

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)
  • Diagram of the process from uninstallation to installation of MySQL 5.7.18 yum under Linux
  • Detailed tutorial on installing MySQL 5.7.17 on Oracle Linux 6.8
  • 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

<<:  How to deploy Node.js with Docker

>>:  Detailed explanation of the WeChat applet request pre-processing method

Recommend

Summary of relevant knowledge points of ajax in jQuery

Preface Students who learn JavaScript know that A...

Docker enables seamless calling of shell commands between container and host

As shown below: nsenter -t 1 -m -u -n -i sh -c &q...

Exploration and correction of the weird behavior of parseInt() in js

Background: I wonder if you have noticed that if ...

JavaScript+html to implement front-end page sliding verification (2)

This article example shares the specific code of ...

Detailed tutorial for downloading and installing mysql8.0.21

Official website address: https://www.mysql.com/ ...

How to run Hadoop and create images in Docker

Reinventing the wheel, here we use repackaging to...

Detailed explanation of the processing of the three Docker Nginx Logs

Because colleagues in the company need Nginx log ...

Using css-loader to implement css module in vue-cli

【Foreword】 Both Vue and React's CSS modular s...

Install nvidia graphics driver under Ubuntu (simple installation method)

Install the nvidia graphics card driver under Ubu...

Learn the common methods and techniques in JS arrays and become a master

Table of contents splice() Method join() Method r...

Summary of 4 solutions for returning values ​​on WeChat Mini Program pages

Table of contents Usage scenarios Solution 1. Use...

How to change password and set password complexity policy in Ubuntu

1. Change password 1. Modify the password of ordi...

How to use the dig/nslookup command to view DNS resolution steps

dig - DNS lookup utility When a domain name acces...