uname -a
# 查看相关包
rpm -qa | grep mariadb
# 卸载相关包
rpm -e 查出来的包名,有依赖的一起删掉就行 https://downloads.mysql.com/archives/community/

将下载的包上传到服务器上
顺序已经列出来了,不要错了
rpm -ivh mysql-community-common-8.0.23-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-plugins-8.0.23-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-8.0.23-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-8.0.23-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-8.0.23-1.el7.x86_64.rpmmysqladmin --version默认的dataDir是对不上的。。需要修改下
vim /etc/my.cnfdatadir=/var/lib/mysql/mysqlsystemctl start mysqldsystemctl status mysqld cat /var/log/mysqld.log | grep passwordmysql -u root -palter user root@localhost identified by 'Root_123456';SHOW VARIABLES LIKE 'validate_password%';
set global validate_password.policy = low;
set global validate_password.length = 4; alter user root@localhost identified by '123456';update user set host='%' where host='localhost';systemctl restart mysqld;