安装说明

  1. 下载目标版本的MySQL源码并上传至服务器“/home”目录下,解压源码包并进入MySQL源码的根目录。

    MySQL源码下载路径请参见表2

    对于MySQL 8.0.25版本,执行以下命令:

    cd /home
    tar -zxvf mysql-boost-8.0.25.tar.gz
    cd mysql-8.0.25

    对于MySQL 8.0.30版本,执行以下命令:

    cd /home
    tar -zxvf mysql-boost-8.0.30.tar.gz
    cd mysql-8.0.30

    对于MySQL 8.0.35版本,执行以下命令:

    cd /home
    tar -zxvf mysql-boost-8.0.35.tar.gz
    cd mysql-8.0.35

    您也可以通过如下命令下载MySQL源码。

    MySQL 8.0.25版本:

    wget https://cdn.mysql.com/archives/mysql-8.0/mysql-boost-8.0.25.tar.gz --no-check-certificate
    tar -zxvf mysql-boost-8.0.25.tar.gz

    MySQL 8.0.30版本:

    wget https://cdn.mysql.com/archives/mysql-8.0/mysql-boost-8.0.30.tar.gz --no-check-certificate
    tar -zxvf mysql-boost-8.0.30.tar.gz

    MySQL 8.0.35版本:

    wget https://cdn.mysql.com/archives/mysql-8.0/mysql-boost-8.0.35.tar.gz --no-check-certificate
    tar -zxvf mysql-boost-8.0.35.tar.gz

  2. 在源码根目录,使用git初始化命令来建立git管理信息。

    git init
    git add -A
    git commit -m "Initial commit"
    • 一般情况下,系统自带git,若需要安装git,请先参见《MySQL 移植指南》中配置Yum源相关内容,再执行如下命令安装git。
      1
      yum install git
      
    • 若未配置git的提交用户信息,git commit前需要先配置用户邮件及用户名称信息。
      1
      2
      git config user.email "123@example.com"
      git config user.name "123"
      

  3. 下载MySQL线程池特性patch,并上传至MySQL源码的根目录。该patch同时适用于MySQL 8.0.25、MySQL 8.0.30和MySQL 8.0.35版本。

    您也可以通过如下命令下载MySQL线程池特性patch。

    wget https://gitee.com/kunpengcompute/mysql-server/releases/download/KunpengBoostKit23.0.RC4.ThreadPool/code-threadpool-for-MySQL-8.0.patch --no-check-certificate

  4. 查看提交之后是否有内容修改。

    1
    git status
    
    如下所示新增了一个code-threadpool-for-MySQL-8.0.patch文件。
    1
    2
    3
    4
    5
    6
    7
    [root@localhost mysql-8.0.25]# git status
    On branch master
    Untracked files:
      (use "git add <file>..." to include in what will be committed)
            code-threadpool-for-MySQL-8.0.patch
    
    nothing added to commit but untracked files present (use "git add" to track)
    

  5. 合入线程池特性patch补丁。

    1
    2
    git apply --check code-threadpool-for-MySQL-8.0.patch
    git apply --whitespace=nowarn code-threadpool-for-MySQL-8.0.patch
    

  6. 合入补丁成功后,在mysql-8.0.25或mysql-8.0.30或mysql-8.0.35目录下可查看到新增的thread_pool目录及目录下新增的源码文件。

    ll ./plugin/thread_pool/

    预期结果:

  7. 根据正常的编译安装MySQL源码的操作步骤进行MySQL的编译安装。详细信息请参见《MySQL 移植指南》。