mysql 5.7 安装_CentOS8 安装 mysql 5.7

22f20ce2bf581eca57cc4036edc928c0.png
# 安装依赖

yum update

yum install ncurses-compat-libs

# 下载安装包
# 可以自行选择下载的版本  https://repo.mysql.com/yum/
wget https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-libs-5.7.31-1.el7.x86_64.rpm
wget https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-common-5.7.31-1.el7.x86_64.rpm
wget https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-client-5.7.31-1.el7.x86_64.rpm
wget https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-server-5.7.31-1.el7.x86_64.rpm

# 安装
rpm -Uvh mysql-community-libs-5.7.31-1.el7.x86_64.rpm
rpm -Uvh mysql-community-common-5.7.31-1.el7.x86_64.rpm
rpm -Uvh mysql-community-client-5.7.31-1.el7.x86_64.rpm
rpm -Uvh mysql-community-server-5.7.31-1.el7.x86_64.rpm

# 启动
systemctl start mysqld

# 查找默认密码
grep 'temporary password' /var/log/mysqld.log

# 使用默认密码登录

mysql -u root -p

# 更改默认密码

set password for 'root'@'localhost' = password('XXXXXXXX');

# 更改密码校验等级

set global validate_password_policy=0;

# 创建新用户密码

create user 'chutianshu'@'%' identified by 'XXXXXXXX';

# 授权
GRANT ALL PRIVILEGES ON *.* TO 'chutianshu'@'%' identified by 'XXXXXXXX';

# 使生效
flush privileges;

# 更改端口

vim /etc/my.cnf
# 在文件中加入
port=63306
参考文章: https:// blog.csdn.net/weixin_42 109012/article/details/102684153
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值