章工运维 章工运维
首页
  • linux
  • windows
  • 中间件
  • 监控
  • 网络
  • 存储
  • 安全
  • 防火墙
  • 数据库
  • 系统
  • docker
  • 运维工具
  • other
  • elk
  • K8S
  • ansible
  • Jenkins
  • GitLabCI_CD
  • 随笔
  • 面试
  • 工具
  • 收藏夹
  • Shell
  • python
  • golang
友链
  • 索引

    • 分类
    • 标签
    • 归档
    • 首页 (opens new window)
    • 关于我 (opens new window)
    • 图床 (opens new window)
    • 评论 (opens new window)
    • 导航栏 (opens new window)
周刊
GitHub (opens new window)

章工运维

业精于勤,荒于嬉
首页
  • linux
  • windows
  • 中间件
  • 监控
  • 网络
  • 存储
  • 安全
  • 防火墙
  • 数据库
  • 系统
  • docker
  • 运维工具
  • other
  • elk
  • K8S
  • ansible
  • Jenkins
  • GitLabCI_CD
  • 随笔
  • 面试
  • 工具
  • 收藏夹
  • Shell
  • python
  • golang
友链
  • 索引

    • 分类
    • 标签
    • 归档
    • 首页 (opens new window)
    • 关于我 (opens new window)
    • 图床 (opens new window)
    • 评论 (opens new window)
    • 导航栏 (opens new window)
周刊
GitHub (opens new window)
  • linux

  • windows

  • 中间件

  • 网络

  • 安全

  • 存储

  • 防火墙

  • 数据库

    • mysql

      • 数据库安装
      • mysql主从搭建
      • mysql客户端和mysqlbinlog工具安装
      • centos7下yum安装mysql5.7
      • centos7下rpm安装mysql
        • mysql高可用集群架构-mha架构
        • mysql-MGR集群搭建
        • mysql的一些命令行操作指令
        • 安装MySQL(Windows 64位),最实用的方式
        • innobackupex实现MySQL备份
        • docker compose部署mysql主从复制(内含故障切换操作)
      • mongodb

      • oracle

      • postgresql

      • redis

    • 系统

    • docker

    • other

    • 监控

    • 运维
    • 数据库
    • mysql
    章工运维
    2023-06-21
    目录

    centos7下rpm安装mysql

    # 下载安装包

    wget https://mirrors.cloud.tencent.com/mysql/yum/mysql-5.7-community-el7-x86_64/mysql-community-client-5.7.35-1.el7.x86_64.rpm
    wget https://mirrors.cloud.tencent.com/mysql/yum/mysql-5.7-community-el7-x86_64/mysql-community-common-5.7.35-1.el7.x86_64.rpm
    wget https://mirrors.cloud.tencent.com/mysql/yum/mysql-5.7-community-el7-x86_64/mysql-community-devel-5.7.35-1.el7.x86_64.rpm
    wget https://mirrors.cloud.tencent.com/mysql/yum/mysql-5.7-community-el7-x86_64/mysql-community-libs-5.7.35-1.el7.x86_64.rpm
    wget https://mirrors.cloud.tencent.com/mysql/yum/mysql-5.7-community-el7-x86_64/mysql-community-server-5.7.35-1.el7.x86_64.rpm
    
    1
    2
    3
    4
    5

    # 卸载mariadb

    rpm -qa | grep mariadb
    
    rpm -e mariadb-libs-5.5.68-1.el7.x86_64 --nodeps
    
    1
    2
    3

    # 按顺序安装

    yum install mysql-community-common-5.7.35-1.el7.x86_64.rpm -y

    yum install mysql-community-libs-5.7.35-1.el7.x86_64.rpm -y

    yum install mysql-community-devel-5.7.35-1.el7.x86_64.rpm -y

    yum install mysql-community-client-5.7.35-1.el7.x86_64.rpm -y

    yum install mysql-community-server-5.7.35-1.el7.x86_64.rpm -y

    # 问题解决

    如果你的系统版本太高,可能会报如下错误

    Error: Problem: conflicting requests

    • nothing provides libtinfo.so.5()(64bit) needed by mysql-community-client-5.7.35-1.el7.x86_64 from @commandline
    • nothing provides libncurses.so.5()(64bit) needed by mysql-community-client-5.7.35-1.el7.x86_64 from @commandline (try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

    解决方法:

    使用 ncurses-compat-libs 来安装兼容性库,这通常是最安全和最有效的方案。

    dnf install epel-release

    dnf install ncurses-compat-libs

    # 配置数据目录

    vi /etc/my.cnf
    #mysql用户
    user=mysql
    #数据目录
    datadir=/data/database/mysql
    #开启binlog
    server-id=1
    log_bin=/data/database/mysql/binlog/mysql-bin
    #不区分大小写
    lower_case_table_names=1
    #设置字符集
    character-set-server=utf8mb4
    # 最大连接数.
    max_connections=2048
    # 打开的文件描述符限制.
    open_files_limit=65535
    group_concat_max_len = 102400
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17

    启动之前请确保mysql目录是否是mysql用户权限

    # 启动服务并修改root密码

    #启动服务
    systemctl start mysqld
    #查看密码
    grep 'temporary password' /var/log/mysqld.log 
    2023-06-21T08:40:31.470093Z 1 [Note] A temporary password is generated for root@localhost: VlVSj#4C1HyD
    
    #登录
    mysql -uroot -p
    #修改密码
    alter user 'root'@'localhost' identified by 'fasG344_32dsf';
    #修改root账号具有远程连接权限
     grant all on *.* to root@'%' identified by 'fasG344_32dsf' with grant option;
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    微信 支付宝
    上次更新: 2024/10/18, 18:39:32

    ← centos7下yum安装mysql5.7 mysql高可用集群架构-mha架构→

    最近更新
    01
    shell脚本模块集合
    05-13
    02
    生活小技巧(认知版)
    04-29
    03
    生活小技巧(防骗版)
    04-29
    更多文章>
    Theme by Vdoing | Copyright © 2019-2025 | 点击查看十年之约 | 鄂ICP备2024072800号
    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式