mysql8 Community Edition installation process centos7, 20200129

This section describes

centos7
mysql8
installation instructions

Data in this chapter is to install Community Edition
does not support clustering of
use is the use of the station and learn to use

Summary - core operating

  1. download
  2. installation
  3. Landed
  4. change Password

Installation password
Python2020 *

Summary - Operating Summary

  1. Rpm warehouse found at the official website
  2. Download the warehouse to the linux, wget
  3. Installing warehouse, rpm -ivh warehouse
  4. Update warehouse, yum makecache
  5. 安装mysql,yum -y install mysql-community-server.x86_64
  6. Initialization, systemctl start mysqld
  7. Set boot, systemctl enable mysqld
  8. Turn off disable the firewall (optional), systemctl stop firewalld, systemctl disable firewalld
  9. Login account, a temporary password to view, grep 'password' /var/log/mysqld.log,2 landed
    10. Change Password, alter user user () identified by 'Python2020 *';

Find warehouse rpm

1, find the page

Note the corresponding version

https://dev.mysql.com/downloads/repo/yum/

2, find the resources

https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm

Here Insert Picture Description

Download warehouse

[root@localhost down]# wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm

Here Insert Picture Description

View the current warehouse

[root@localhost down]# yum repolist

Here Insert Picture Description

Download the installation of this warehouse

[root@localhost down]# rpm -ivh mysql80-community-release-el7-3.noarch.rpm 

Here Insert Picture Description

After installing warehouse View

Here Insert Picture Description

Or check like this

Here Insert Picture Description

I found a new warehouse mysql

Update warehouse

[root@localhost down]# yum makecache

Here Insert Picture Description

Experience what effect after update

Here Insert Picture Description

Experience what documentation is complete

To verify the integrity value by md5

[root@localhost down]# md5sum mysql80-community-release-el7-3.noarch.rpm 

Here Insert Picture Description

When comparing download

Here Insert Picture Description

Like, the instructions to download is complete

Watch md5 value

Ready to install, check the package name

Fuzzy looking for it, found in the relevant package

[root@localhost down]# yum list | grep mysql-com

Here Insert Picture Description

Installation package

[root@localhost down]# yum -y install mysql-community-server.x86_64

result

Here Insert Picture Description

Patience download

Here Insert Picture Description

Installed

Here Insert Picture Description

Experience, mounted directly by the virtual machine is much faster than using xshell

Mainly download speeds much faster

"Hit pit Record

Here Insert Picture Description

After installation

"Catalog database

[root@localhost ~]# ls /var/lib/mysql

It is empty

Here Insert Picture Description

The first time you start initialization

"Look before you initialize

[root@localhost ~]# ls /var/lib/mysql

There is no content directory

Here Insert Picture Description

"initialization

[root@localhost ~]# systemctl start mysqld

After that, there are a lot of content appeared

Here Insert Picture Description

Mysql is set to boot automatically

[root@localhost ~]# systemctl enable mysqld

Here Insert Picture Description

Turn off the firewall

Turn off the firewall

[root@localhost ~]# systemctl stop firewalld

Here Insert Picture Description

Disable the firewall

[root@localhost ~]# systemctl disable firewalld

Here Insert Picture Description

View Temporary Password

"View temporary account password

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

Here Insert Picture Description

Use a temporary password mysql

[root@localhost ~]# mysql -uroot -p'A5qi?hxkwjyq';

Note, the password is here on a temporary password to check out of step

Here Insert Picture Description

Remember what the relevant directory

Rpm or installed by the mysql yum

Directory is located

/var/lib/mysql

Here Insert Picture Description

Use the password-free login password when the operation mode, set

1, find the configuration file

"/etc/my.cnf" 31L, 1243C                                                           1,1          全部

By vim open

/etc/my.cnf

Here Insert Picture Description

2, Add code

skip-grant-tables

Here Insert Picture Description

3, restart mysql

[root@localhost etc]# service mysqld restart

Here Insert Picture Description

4, enter mysql, no password is required

[root@localhost etc]# mysql

Here Insert Picture Description

Second, change your password

In the mysql command

1, see the User table

There is a user table in mysql

mysql> select user,host,authentication_string from mysql.user;

Here Insert Picture Description

change Password

  • Login account to view and use the temporary password account

1 View Temporary Password

grep 'password' /var/log/mysqld.log

2 Use a temporary password

mysql -uroot -p'临时密码';

3 Change Password

alter user user() identified by 'Python2020*';

Here Insert Picture Description

4, using the new password

[root@localhost ~]# mysql -uroot -pPython2020*

Here Insert Picture Description

Published 847 original articles · won praise 43 · views 130 000 +

Guess you like

Origin blog.csdn.net/ifubing/article/details/104104444