本文主要是介绍MySQL8.0 Bundle RPM安装过程,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
安装包下载地址
MySQL 8.0.22官网下载地址【下载】
MySQL 最新版官网下载地址【前往】
清理旧的mysql环境
1、查看当前安装的相关包
rpm -qa|grep -i mysql
也可能是
rpm -qa|grep -i mariadb
2.a、卸载相关包,如
rpm -e --nodeps mysql-community-server-8.0.22-1.el7.x86_64
2.b、删除相关目录,如
#查找mysql相关目录
find / -name mysql
rm -rf /var/lib/mysql /var/lib/mysql/mysql /usr/bin/mysql /usr/lib64/mysql /usr/share/mysql /var/log/mysqld.log
安装以及登录
3、解压tar安装包
tar -xvf mysql-8.0.22-1.el7.x86_64.rpm-bundle.tar
4、使用yum安装先行依赖包
yum -y install libaio
yum -y install perl
yum -y install net-tools
5、按顺序安装rpm包
rpm -ivh mysql-community-common-8.0.22-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-plugins-8.0.22-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-8.0.22-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-8.0.22-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-8.0.22-1.el7.x86_64.rpm
6、查看、启动mysqld服务
systemctl status mysqld
systemctl start mysqld
7、第一次登录,使用数据库临时密码(必须先启动mysqld服务)
#查找临时密码
grep "temporary password" /var/log/mysqld.log
8、使用临时密码登录,并设置新密码
登录MySQL:mysql -uroot -p
如需使用简单密码(MySQL 8.0不支持):set global validate_password_policy=0;set global validate_password_length=1;
设置密码:alter user 'root'@'localhost' identified by '123456';flush privileges;
9、创建远程登录账号
#MySQL 5.7
grant replication slave on *.* to repl@'192.168.73.%' identified by '123456';
flush privileges;#MySQL 8.0
create user repl@'192.168.73.%' identified by '123456';
grant all privileges on *.* to repl@'192.168.73.%' with grant option;
flush privileges;
10、使用旧版密码插件
ALTER USER repl@'192.168.73.%' IDENTIFIED BY '123456' PASSWORD EXPIRE NEVER;
ALTER USER repl@'192.168.73.%' IDENTIFIED WITH mysql_native_password BY '123456';
FLUSH PRIVILEGES;
这篇关于MySQL8.0 Bundle RPM安装过程的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!