mysql-8.0.19-1.el7.x86_64.rpm-bundle.tar.tar
1、清除之前的mysql库
yum remove mysql-libs
2、安装rpm
rpm -ivh mysql-community-common-8.0.19-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-8.0.19-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-8.0.19-1.el7.x86_64.rpm 等等
3、
/var/log/mysqld.log 里得到root初始密码
4、设置新密码
alter user ‘root’@‘localhost’ identified by ‘Zthrxytech9-’;
5、创建新用户
create user ‘epwbs’@‘%’ identified with mysql_native_password by ‘Zthrxytech8-’; //mysql_native_password表示用老的密码登录方式 %表示可以远程登录 如果是loaclhost就只能本地了
update user set host = ‘%’ where user = ‘root’;
grant all on . to ‘epwbs’@‘%’;
grant all on . to ‘epwbs’@‘%’ ;
grant all privileges on . to ‘epwbs’@‘%’;
flush privileges ;
CREATE USER ‘xytech’@‘localhost’ IDENTIFIED BY ‘dfxwbz-420’;
#GRANT 不需要密码了
GRANT ALL PRIVILEGES ON . TO ‘xytech’@‘localhost’
GRANT ALL PRIVILEGES ON . TO ‘xytech’@‘%’
flush privileges;