//下载源安装包
wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
//安装源
yum localinstall mysql57-community-release-el7-8.noarch.rpm
//安装mysql
yum install mysql-community-server
//启动服务
systemctl start mysqld
//查看生成的原始密码
grep 'temporary password' /var/log/mysqld.log
//登录mysql
mysql -uroot -p //然后输入上面显示的原始密码
//修改密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root123';
//密码太简单会被拒绝,先把设置的密码的要求改低,在执行改密码
set global validate_password_policy=0; //密码的值
set global validate_password_length=1; //密码长度
//授权给其他机器访问登录
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
//使生效
FLUSH PRIVILEGES; Article
⚠️ 本文最后更新于2024年08月14日,已经过了473天没有更新,若内容或图片失效,请留言反馈
♾️ text 代码:
现在已有 0 条评论,0 人点赞