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
- download
- installation
- Landed
- change Password
Installation password
Python2020 *
Summary - Operating Summary
- Rpm warehouse found at the official website
- Download the warehouse to the linux, wget
- Installing warehouse, rpm -ivh warehouse
- Update warehouse, yum makecache
- 安装mysql,yum -y install mysql-community-server.x86_64
- Initialization, systemctl start mysqld
- Set boot, systemctl enable mysqld
- Turn off disable the firewall (optional), systemctl stop firewalld, systemctl disable firewalld
- 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
Download warehouse
[root@localhost down]# wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
View the current warehouse
[root@localhost down]# yum repolist
Download the installation of this warehouse
[root@localhost down]# rpm -ivh mysql80-community-release-el7-3.noarch.rpm
After installing warehouse View
Or check like this
I found a new warehouse mysql
Update warehouse
[root@localhost down]# yum makecache
Experience what effect after update
Experience what documentation is complete
To verify the integrity value by md5
[root@localhost down]# md5sum mysql80-community-release-el7-3.noarch.rpm
When comparing download
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
Installation package
[root@localhost down]# yum -y install mysql-community-server.x86_64
result
Patience download
Installed
Experience, mounted directly by the virtual machine is much faster than using xshell
Mainly download speeds much faster
"Hit pit Record
After installation
"Catalog database
[root@localhost ~]# ls /var/lib/mysql
It is empty
The first time you start initialization
"Look before you initialize
[root@localhost ~]# ls /var/lib/mysql
There is no content directory
"initialization
[root@localhost ~]# systemctl start mysqld
After that, there are a lot of content appeared
Mysql is set to boot automatically
[root@localhost ~]# systemctl enable mysqld
Turn off the firewall
Turn off the firewall
[root@localhost ~]# systemctl stop firewalld
Disable the firewall
[root@localhost ~]# systemctl disable firewalld
View Temporary Password
"View temporary account password
[root@localhost ~]# grep 'password' /var/log/mysqld.log
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
Remember what the relevant directory
Rpm or installed by the mysql yum
Directory is located
/var/lib/mysql
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
2, Add code
skip-grant-tables
3, restart mysql
[root@localhost etc]# service mysqld restart
4, enter mysql, no password is required
[root@localhost etc]# mysql
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;
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*';
4, using the new password
[root@localhost ~]# mysql -uroot -pPython2020*