# 下载mysql源
wget https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpm
# 安装mysql数据源
yum install mysql80-community-release-el8-1.noarch.rpm
# 检测mysql源是否安装成功
yum repolist enabled | grep "mysql.*-community.*"
# 禁用centos自带的mysql模块
yum module disable mysql
# 安装mysql
yum install mysql-community-server
service mysqld status
service mysqld start
# 查找随机密码
grep 'temporary password' /var/log/mysqld.log
mysql -uroot -p
# 修改默认密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Root_21root'
# 查看密码策略
SHOW VARIABLES LIKE 'validate_password%';
# 修改密码长度
set global validate_password.length=1;
# 修改密码等级
set global validate_password.policy=0;
# 设置自己想要的密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'xxxxxxxx'
mysql允许远程连接
create user 'root'@'%' identified by 'xxxxxxx';
grant all privileges on *.* to 'root'@'%' with grant option;
FLUSH PRIVILEGES;
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。