yum -y update
yum -y install lrzsz gcc gcc-c++ zlib zlib-devel openssl openssl-devel pcre-devel vim net-tools man wget tar
wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.31-1.el8.x86_64.rpm-bundle.tar
mkdir mysql
tar -xvf mysql-8.0.31-1.el8.x86_64.rpm-bundle.tar -C mysql
cd mysql
rm -f *debug*
rpm -ivh *.rpm --force --nodeps
systemctl start mysqld
systemctl enable mysqld
grep 'temporary password' /var/log/mysqld.log
mysql -h localhost -uroot -p
system clear
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Lihaozhe!!@@1122';
flush privileges;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Lihaozhe!!@@1122';
flush privileges;
update mysql.user set host = '%',plugin='mysql_native_password' where user='root';
flush privileges;
quit;
systemctl restart mysqld
mysql -h 127.0.0.1 -uroot -p
show variables like'%character%';
编辑配置文件修改服务器端字符集
vim /etc/my.cnf
#在[mysqld]下面增加
character-set-server=utf8mb4
systemctl restart mysqld