安装 mysql 特定版本(无法找到包)

安装 mysql 特定版本(无法找到包)

我已经使用以下命令安装了 MySQLUbuntu 14.04

apt-get install mysql-server

现在检查版本,它会自动安装最新版本

mysql --version

展示

mysql Ver 14.14 Distrib 5.7.18,适用于 Linux (x86_64),使用 EditLine 包装器

但我需要安装精确版本的MySQL 5.7.17所以试图跑

 apt-get install mysql-client-5.7.17 mysql-client-core-5.7.17

但它给出了如下错误

Reading state information... Done  
E: Unable to locate package-client-5.7.17  
E: Couldn't find any package by regex-client-5.7.17'  
E: Unable to locate package mysql-client-core-5.7.17  
E: Couldn't find any package by regex 'mysql-client-core-5.7.17'

我该如何做呢?我需要分别安装mysql-client和吗mysql-server

编辑

还尝试使用下载特定版本获得

wget https://dev.mysql.com/downloads/gpg/?file=mysql-community-source_5.7.17-1ubuntu14.04_i386.deb

但尚未下载;查看终端输出

--2017-06-05 11:19:29--  https://dev.mysql.com/downloads/gpg/?file=mysql-community-source_5.7.17-1ubuntu14.04_i386.deb
Resolving dev.mysql.com (dev.mysql.com)... 137.254.60.11
Connecting to dev.mysql.com (dev.mysql.com)|137.254.60.11|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘index.html?file=mysql-community-source_5.7.17-1ubuntu14.04_i386.deb.1’

    [   <=>                                                                                   ] 16,416      28.3KB/s   in 0.6s   

2017-06-05 11:19:31 (28.3 KB/s) - ‘index.html?file=mysql-community-source_5.7.17-1ubuntu14.04_i386.deb.1’ saved [16416]

答案1

这是我解决这个问题的方法

  1. 从系统中删除所有 MySQL 实例

    sudo -i  
    service mysql stop  #or mysqld 
    killall -9 mysql    #or mysqld
    apt-get remove --purge mysql-client  
    apt-get remove --purge mysql-server  
    apt-get remove --purge mysql-common  
    
    # delete log and configuration files 
    rm -rf /var/lib/mysql  
    rm -rf /var/log/mysql
    rm -rf /etc/mysql
    
  2. 现在从以下位置下载 .deb 文件MySQL 档案

    │ │ ── mysql-client_5.7.17-1ubuntu14.04_amd64.deb
    │ ── mysql-common_5.7.17-1ubuntu14.04_amd64.deb
    │ ── mysql-community-client_5.7.17-1ubuntu14.04_amd64.deb │ ── mysql-community-server_5.7.17-1ubuntu14.04_amd64.deb
    │ ──
    mysql
    -server_5.7.17-1ubuntu14.04_amd64.deb │ ── mysql-server_5.7.17-1ubuntu14.04_amd64.deb-bundle.tar
    └── mysql-testsuite_5.7.17-1ubuntu14.04_amd64.deb

  3. 按以下顺序安装

    dpkg -i mysql-common_5.7.9-1ubuntu14.04_amd64.deb  
    dpkg -i mysql-community-client_5.7.9-1ubuntu14.04_amd64.deb  
    dpkg -i mysql-client_5.7.9-1ubuntu14.04_amd64.deb  
    dpkg -i mysql-community-server_5.7.9-1ubuntu14.04_amd64.deb  
    dpkg -i mysql-server_5.7.9-1ubuntu14.04_amd64.deb  
    

注意:libmecab2如果安装上述包时出现任何错误,请安装

sudo apt-get install libmecab2

这将提示您设置 mysql 的 root 密码;请随意设置

现在检查

mysql-version

mysql Ver 14.14 Distrib 5.7.17,适用于 Linux (x86_64),使用 EditLine 包装器

参考链接

  1. https://bugs.mysql.com/bug.php?id=78936
  2. http://installion.co.uk/ubuntu/trusty/universe/l/libmecab2/install/index.html
  3. https://dev.mysql.com/doc/refman/5.6/en/linux-installation-debian.html

相关内容