简体   繁体   English

在 Ubuntu 18.04 上安装 MySQL 客户端 5.6

[英]Installing MySQL Client 5.6 on Ubuntu 18.04

I have a legacy project that I'm trying to modernize, and part of that involves setting up a more efficient system of automated backups using mysqldump .我有一个我正在尝试现代化的遗留项目,其中一部分涉及使用mysqldump设置更有效的自动备份系统。

The app's database is using MySQL 5.6, and is hosted via an RDS instance.该应用程序的数据库使用 MySQL 5.6,并通过 RDS 实例托管。 To get mysqldump up and running, I believe I need to install a version of mysql-client that corresponds to 5.6.要启动并运行mysqldump ,我相信我需要安装与 5.6 对应的mysql-client版本。

However, running apt-get install mysql-client installs 8.0 by default.但是,运行apt-get install mysql-client默认安装 8.0。 However, I can't find any version-specific versions of mysql-client available.但是,我找不到任何特定版本的mysql-client可用。 Running sudo apt-get install mysql-client-5.7 returns a notice that there's no installation candidate available.运行sudo apt-get install mysql-client-5.7返回一条通知,指出没有可用的安装候选。

Is it still possible to install older versions of mysql-client ?是否仍然可以安装旧版本的mysql-client If not, is there another way to get ahold of the mysqldump functionality?如果没有,是否有另一种方法可以获得mysqldump功能?

Edit: As @exussum noted below, 8.0 is backwards compatible with 5.6 and 5.7.编辑:正如下面@exussum 所指出的,8.0 向后兼容 5.6 和 5.7。 I was hitting errors when running mysqldump , which I'd assumed indicated incompatibility, but were actually related to my app specifically.我在运行mysqldump时遇到错误,我认为这表明不兼容,但实际上与我的应用程序特别相关。

They are backwards compatible, so you can use mysql-client 8 to dump mysql-server 5.5它们向后兼容,因此您可以使用 mysql-client 8 转储 mysql-server 5.5

to get a specific version docker is great获取特定版本 docker 很棒

( sudo apt install docker ) to install ( sudo apt install docker ) 安装

docker run mysql:5.6 mysqldump

will run mysqldump though docker, and you can choose your version there easily enough将通过 docker 运行 mysqldump,你可以很容易地在那里选择你的版本

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM