环境简介
操作系统:centos8 CPU架构:aarch
安装步骤
- 清除mysql相关包
rpm -qa | grep mysql
yum remove xxx
- 安装centos8下MySQL8的yum源
wget https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpm
rpm -ivh mysql80-community-release-el8-1.noarch.rpm
- 关闭默认的MySQL(一定要执行,不然安装时会提示找不到包)
yum module disable mysql
- 安装MySQL
yum install mysql-community-server --nogpgcheck
- 启动MySQL服务,查看运行状态
systemctl start mysqld
systemctl status mysqld
- 查找初始密码并登录修改密码
grep 'temporary password' /var/log/mysqld.log
mysql -uroot -p
ALTER USER 'root'@'localhost' IDENTIFIED BY '默认密码';
set global validate_password.policy=LOW;
set global validate_password.length=6;
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
flush privileges;
exit;
systemctl restart mysqld;
- 配置root远程登录
mysql -uroot -p123456
use mysql;
update user set host='%' where user='root';
exit;
systemctl restart mysqld;
|