Detailed steps for installing and debugging MySQL database on CentOS7 [Example]

Detailed steps for installing and debugging MySQL database on CentOS7 [Example]

This example requires downloading and installing the debugging MySQL database.

Step 1: Download all the software required to install the MySQL database.

I have downloaded the database software in advance, and I can download it directly on the server, as follows:

Download directly via scp:

[root@agt20 ~]# scp [email protected]:/root/mysql* /root/

The software is as follows:

[root@agt20 ~]# ls mysql-*
mysql-5.7.17.tar
mysql-community-client-5.7.17-1.el7.x86_64.rpm
mysql-community-common-5.7.17-1.el7.x86_64.rpm
mysql-community-devel-5.7.17-1.el7.x86_64.rpm
mysql-community-embedded-5.7.17-1.el7.x86_64.rpm
mysql-community-embedded-compat-5.7.17-1.el7.x86_64.rpm
mysql-community-embedded-devel-5.7.17-1.el7.x86_64.rpm
mysql-community-libs-5.7.17-1.el7.x86_64.rpm
mysql-community-libs-compat-5.7.17-1.el7.x86_64.rpm
mysql-community-minimal-debuginfo-5.7.17-1.el7.x86_64.rpm
mysql-community-server-5.7.17-1.el7.x86_64.rpm
mysql-community-test-5.7.17-1.el7.x86_64.rpm

Step 2: Install through yum, start the server and view

[root@agt20 ~]# yum -y install mysql-*.rpm
[root@agt20 ~]# systemctl restart mysqld
[root@agt20 ~]# systemctl enable mysqld
[root@agt20 ~]# systemctl status mysqld.service 
mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since \u4e8c 2019-10-15 11:29:11 CST; 1min 15s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Main PID: 31584 (mysqld)
CGroup: /system.slice/mysqld.service
\u2514\u250031584 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid...

10\u6708 15 11:28:42 agt20.tedu.cn systemd[1]: Starting MySQL Server...
10\u6708 15 11:29:11 agt20.tedu.cn systemd[1]: Started MySQL Server.
[root@agt20 ~]#

Step 3: Connect to MySQL server and change password;

1) View the initial password

[root@agt20 ~]# grep -i 'password' /var/log/mysqld.log 
2019-10-15T03:28:55.200931Z 1 [Note] A temporary password is generated for root@localhost: r3qhDysMrM)

2) Use the initial password to connect to the MySQL service

[root@agt20 ~]# mysql -uroot -p'r3qhDysMrM)'
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.17
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>

3) Reset the local login password of the database administrator roo

mysql> alter user root@localhost identified by 'Pwd@123...';
Query OK, 0 rows affected (0.00 sec)

4) Modify password policy

mysql> set global validate_password_policy=0;
Query OK, 0 rows affected (0.01 sec)
mysql> set global validate_password_length=6;
Query OK, 0 rows affected (0.00 sec)
mysql> alter user root@localhost identified by 'pwd@123';
Query OK, 0 rows affected (0.00 sec)

5) Log in using the changed password

[root@agt20 ~]# mysql -uroot -ppwd@123
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.17 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>

At this point, the installation and debugging of the Mysql database is completed! ! ! !

Summarize

The above is the detailed steps of installing and debugging MySQL database on CentOS7 introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor 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:
  • Tutorial on installing mysql under centos7
  • CentOS7 uses yum to install mysql 8.0.12
  • Detailed tutorial on installing MySQL 8.0 from source code on CentOS 7.4
  • Installation tutorial of mysql8.0rpm on centos7
  • Tutorial on installing lnmp using yum on centos7 (linux+nginx+php7.1+mysql5.7)
  • Centos7 installation and configuration of Mysql5.7

<<:  Summary of MySQL time statistics methods

>>:  vue-router history mode server-side configuration process record

Recommend

CentOS7 uses rpm package to install mysql 5.7.18

illustrate This article was written on 2017-05-20...

Example of how to implement underline effects using Css and JS

This article mainly describes two kinds of underl...

How to build mysql master-slave server on centos7 (graphic tutorial)

This article mainly introduces how to build a MyS...

dl, dt, dd list label examples

The dd and dt tags are used for lists. We usually...

CSS3 realizes the childhood paper airplane

Today we are going to make origami airplanes (the...

Introduction to HTML method of opening link files using hyperlinks

a and href attributes HTML uses <a> to repr...

How to set a fixed IP in Linux (tested and effective)

First, open the virtual machine Open xshell5 to c...

Detailed tutorial on MySQL installation and configuration

Table of contents Installation-free version of My...

Detailed explanation of Linux commands sort, uniq, tr tools

Sort Tool The Linux sort command is used to sort ...

Detailed explanation of the basic knowledge of front-end componentization

Table of contents Basic concepts of components Th...

Detailed explanation of the use of MySQL Online DDL

Table of contents text LOCK parameter ALGORITHM p...

CSS realizes the realization of background image screen adaptation

When making a homepage such as a login page, you ...

How to use Docker to build a tomcat cluster using nginx (with pictures and text)

First, create a tomcat folder. To facilitate the ...