Fedora 23安装配置mysql数据库,修改初始密码及登陆

时间:2024-05-24 21:05:38
  1. 下载MySQL5.7.9 yum仓库

    wget http://dev.mysql.com/get/mysql57-community-release-fc23-7-noarch.rpm

  2. rpm -ivh mysql57-community-release-fc23-7-noarch.rpm
  3. 验证仓库

    dnf repolist enable | grep "mysql.*-community.*"

  4. 安装

    dnf install mysql-community-server

  5. 启动mysql服务

    service mysql start

  6. 查看mysql服务状态

    service mysql status

  7. 获取临时密码

    cat /var/log/mysql.log | grep "A temporary password"

  8. 修改密码

    mysql –uroot –p password
    首先提示输入上一步搜索到的临时密码
    然后输入新密码

  9. 登陆mysql
    mysql –u username –p