centos安装mysql8.0.32

  • 查看mariadb
rpm -qa|grep mariadb
  • 删除 nodeps mariadb-libs
rpm -e --nodeps mariadb-libs
  • 去官网下载mysql-bundle.tar文件
wget https://cdn.mysql.com/archives/mysql-8.0/mysql-8.0.32-1.el9.x86_64.rpm-bundle.tar
  • 解压缩
tar -xvf mysql-8.0.32-1.el9.x86_64.rpm-bundle.tar -C mysql8.0.32/
  • 开始安装

按顺序执行

rpm -ivh mysql-community-common-8.0.32-1.el9.x86_64.rpm

rpm -ivh mysql-community-client-plugins-8.0.32-1.el9.x86_64.rpm

rpm -ivh mysql-community-libs-8.0.32-1.el9.x86_64.rpm

rpm -ivh mysql-community-client-8.0.32-1.el9.x86_64.rpm

rpm -ivh mysql-community-icu-data-files-8.0.32-1.el9.x86_64.rpm

rpm -ivh mysql-community-server-8.0.32-1.el9.x86_64.rpm

  • 遇到报错
错误:依赖检测失败:
        libaio.so.1()(64bit) 被 mysql-community-server-8.0.32-1.el7.x86_64 需要
        libaio.so.1(LIBAIO_0.1)(64bit) 被 mysql-community-server-8.0.32-1.el7.x86_64 需要
        libaio.so.1(LIBAIO_0.4)(64bit) 被 mysql-community-server-8.0.32-1.el7.x86_64 需要
        mysql-community-icu-data-files = 8.0.32-1.el7 被 mysql-community-server-8.0.32-1.el7.x86_64 需要
error: Failed dependencies:
        libnuma.so.1()(64bit) is needed by mysql-community-server-5.7.9-1.el6.x86_64
        libnuma.so.1(libnuma_1.1)(64bit) is needed by mysql-community-server-5.7.9-1.el6.x86_64
        libnuma.so.1(libnuma_1.2)(64bit) is needed by mysql-community-server-5.7.9-1.el6.x86_64

解决办法:

yum install libaio

yum install numactl

  • 检查mysql状态
service mysqld status
  • 开启mysql服务
service mysqld start
  • 首次开启后获取临时密码
grep password /var/log/mysqld.log
  • 进入mysql后,修改root账号的密码
ALTER USER 'root'@'localhost' IDENTIFIED WITH MYSQL_NATIVE_PASSWORD BY '密码';
Flush privileges;
  • 修改密码时,出现密码不符合安全策略的报错
# 降低安全策略
set global validate_password.policy=LOW;
# 降低密码长度需求
set global validate_password.length=4;
#  设置英文字母(包含大小写)最小长度
set global validate_password.mixed_case_count=0;
# 刷新权限
FLUSH PRIVILEGES;
  • 创建新用户
create user "用户名"@"%" identified WITH MYSQL_NATIVE_PASSWORD BY '密码';
grant all privileges on *.* to '用户名'@'%' with grant option;
flush privileges;

  • 9
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值