Linux 下安装MySQL8

一、下载对应系统的MySQL版本,并上传到要安装的服务器上

MySQL :: Download MySQL Yum Repository

二、开始安装

  1. 添加到yum库
    1. 命令:
      #下载    https://repo.mysql.com//mysql80-community-release-el8-1.noarch.rpm
      
      yum install mysql80-community-release-el7-3.noarch.rpm
    2. 查看是否添加成功命令:
      yum repolist enabled | grep "mysql.*-community.*"
  2. 安装命令:
     yum install mysql-community-server
    
    # 如果出现 Unable to find a match: mysql-community-server 请先禁用本地组件再安装
    
    yum module disable mysql
    
    yum install mysql-community-server
    
    
    
  3. 查看是安装目录和版本
  4.  启动MySQL
    systemctl start mysqld

 启动成功后需要先生成临时密码登录并修改设置新密码

# 生成 root@localhost 的临时密码
grep 'temporary password' /var/log/mysqld.log

 使用临时密码登录后修改密码

 退出 使用新密码就可以登录了

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值