Ubuntu 22.04.1 安装 MySQL 指定版(8.0.28)

时间:2025-03-31 18:40:53
  • 下载 MySQL 安装包
    • 链接中的 8.0.28 代表 MySQL 版本号
    • 链接中的 ubuntu21.10 代表乌班图系统的版本号(安装的系统为 Ubuntu 22,但是 MySQL 官方未提供,故选择比较接近的版本)
    wget /apt/ubuntu/pool/mysql-8.0/m/mysql-community/mysql-community-server_8.0.28-1ubuntu21.10_amd64.deb
    wget /apt/ubuntu/pool/mysql-8.0/m/mysql-community/mysql-common_8.0.28-1ubuntu21.10_amd64.deb
    wget /apt/ubuntu/pool/mysql-8.0/m/mysql-community/mysql-community-client-plugins_8.0.28-1ubuntu21.10_amd64.deb
    wget /apt/ubuntu/pool/mysql-8.0/m/mysql-community/mysql-community-client-core_8.0.28-1ubuntu21.10_amd64.deb
    wget /apt/ubuntu/pool/mysql-8.0/m/mysql-community/mysql-community-client_8.0.28-1ubuntu21.10_amd64.deb
    wget /apt/ubuntu/pool/mysql-8.0/m/mysql-community/mysql-client_8.0.28-1ubuntu21.10_amd64.deb
    wget /apt/ubuntu/pool/mysql-8.0/m/mysql-community/mysql-community-server-core_8.0.28-1ubuntu21.10_amd64.deb
    
  • 安装依赖
    sudo apt install -y libaio1 libmecab2 man-db libc-bin
    
    # 如果 URL 不存在,可以访问 /ubuntu/pool/main/o/openssl/ 找到新版的 libssl1.1 进行下载、安装
    wget /ubuntu/pool/main/o/openssl/libssl1.1_1.1.1-1ubuntu2.1~18.04.20_amd64.deb
    sudo dpkg -i libssl1.1_1.1.1-1ubuntu2.1~18.04.20_amd64.deb
    
  • 按照下列顺序安装
    sudo dpkg -i mysql-community-server-core_8.0.28-1ubuntu21.10_amd64.deb
    sudo dpkg -i mysql-common_8.0.28-1ubuntu21.10_amd64.deb
    sudo dpkg -i mysql-community-client-plugins_8.0.28-1ubuntu21.10_amd64.deb
    sudo dpkg -i mysql-community-client-core_8.0.28-1ubuntu21.10_amd64.deb
    sudo dpkg -i mysql-community-client_8.0.28-1ubuntu21.10_amd64.deb
    sudo dpkg -i mysql-client_8.0.28-1ubuntu21.10_amd64.deb
    sudo dpkg -i mysql-community-server_8.0.28-1ubuntu21.10_amd64.deb