安装过程(5.7):

wget https://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm

rpm -ivh mysql57-community-release-el7-10.noarch.rpm

rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022

yum install -y mysql-community-server

systemctl start mysqld

修改密码:

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

set global validate_password_policy=LOW;
set global validate_password_length=4;

ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';

修改配置:vi /etc/my.cnf

[client]
default-character-set=utf8

[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci