mysql在线安装流程:
1.解压:
rpm -ivh mysql80-community-release-el7-10.noarch.rpm
2.切换路径
cd /etc/yum.repo.d
3.选择mysql的版本(默认8.0)
vim mysql-community.repo
4.在线安装
yum -y install mysql-community-server
5.启动mysql服务(之后不再启动)
service mysqld start
6.查找临时密码
cat /var/log/mysqld.log |grep "temporary password"
7.改密码 123456
需要降低mysql的密码安全等级
set global validate_password_policy=LOW;
set global validate_password_length=6;
再修改密码
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
8.授权登录: 元数据
use mysql;
GRANT ALL ON *.* TO root@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;