参考文档:CentOS7.3下安装MySql5.7

  1. 从MySQL官网找到yum源
    MySQL官网
    Linux学习笔记——CentOS7.3搭建mysql8
    yum源:mysql80-community-release-el7-3.noarch.rpm

  2. 下载yum源
    命令:wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
    /get/后面为找到的yum源
    Linux学习笔记——CentOS7.3搭建mysql8

  3. 安装yum源
    命令:yum localinstall mysql80-community-release-el7-3.noarch.rpm
    Linux学习笔记——CentOS7.3搭建mysql8
    安装完成后如下
    Linux学习笔记——CentOS7.3搭建mysql8
    检测yum源是否安装成功
    命令:yum repolist enabled | grep “mysql.*-community.*”
    Linux学习笔记——CentOS7.3搭建mysql8

  4. 安装mysql
    命令:yum install mysql-community-server
    Linux学习笔记——CentOS7.3搭建mysql8
    安装完成后如下
    Linux学习笔记——CentOS7.3搭建mysql8

  5. 相关命令
    启动mysql:systemctl start mysqld
    关闭mysql:systemctl stop mysqld
    重启mysql:systemctl restart mysqld
    查看mysql状态:systemctl status mysqld
    设置mysql随系统启动而启动:systemctl enable mysqld
    关闭mysql随系统启动而启动:systemctl disable mysqld

  6. 查看mysql下root账号的默认密码
    命令:grep ‘temporary password’ /var/log/mysqld.log
    Linux学习笔记——CentOS7.3搭建mysql8

  7. mysql配置文件路径
    配置文件:/etc/my.cnf
    日志文件:/var/log//var/log/mysqld.log
    服务启动脚本:/usr/lib/systemd/system/mysqld.service
    socket文件:/var/run/mysqld/mysqld.pid

  8. 查看密码策略
    命令:show variables like ‘%password%’;
    修改密码策略:set global validate_password.policy=0;(0或LOW代表低级)

  9. 查看字符编码
    命令: show variables like ‘%character%’;

相关文章:

  • 2021-05-06
  • 2021-08-02
  • 2021-11-30
  • 2021-10-22
  • 2021-05-09
  • 2021-06-18
  • 2021-12-21
猜你喜欢
  • 2021-10-23
  • 2021-09-09
  • 2021-04-16
  • 2022-12-23
  • 2021-10-04
  • 2021-06-12
  • 2021-07-19
相关资源
相似解决方案