目录
mysql rpm安装
安装包下载
官网: https://dev.mysql.com/downloads/mysql/
下载完成后你应该拥有下面四个包文件
安装mysql
//安装
for i in `ls *.rpm`;do rpm -ivh $i --force --nodeps;done
//启动
systemctl start mysqld
//获取初始密码
cat /var/log/mysqld.log| grep password
//登陆mysql
mysql -uroot -p
//修改密码
ALTER USER USER() IDENTIFIED BY '123456Admin@123';
//授权
grant all privileges on *.* to 'root'@'%' identified by '123456Admin@123' with grant option;
//刷线权限
flush privileges;
//修改密码策略,把root密码改成更简单的密码
set global validate_password_policy=0;
set global validate_password_length=1;
flush privileges;
//修改root的密码为root
alter user 'root'@'localhost' identified by 'root';
//授权
grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option;
flush privileges;
//mysql安装好后,navicat连接不上报错
use mysql;
alter user 'root'@'%' identified with mysql_native_password by 'yourpassword';
flush privileges;
标签:rpm,privileges,mysql,flush,root,password,安装
From: https://www.cnblogs.com/liwenchao1995/p/16873789.html