无法在 Ubuntu 上安装 mysqldump

无法在 Ubuntu 上安装 mysqldump

另一位技术人员最近在我们的 LAMP 服务器上重新安装了 mysql,现在我无法再使用 mysqldump 了。

# mysqldump
The program 'mysqldump' is currently not installed.  You can install it by typing:
apt-get install mysql-client-5.5

所以我这样做:

apt-get install mysql-client-5.5
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 percona-server-server-5.5 : Depends: percona-server-client-5.5 (>= 1:5.5.36-rel34.2-648.precise) but     it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

好的,我这么做:

apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  libterm-readkey-perl mysql-common
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  percona-server-client-5.5
The following NEW packages will be installed:
  percona-server-client-5.5
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
Need to get 0 B/8,371 kB of archives.
After this operation, 30.7 MB of additional disk space will be used.
Do you want to continue [Y/n]? 

这听起来像是要删除一些 mysql 内容并安装另一种数据库,但是好的“Y”。

(Reading database ... 67693 files and directories currently installed.)
Unpacking percona-server-client-5.5 (from .../percona-server-client-5.5_1%3a5.5.36-rel34.2-    648.precise_i386.deb) ...
dpkg: error processing /var/cache/apt/archives/percona-server-client-5.5_1%3a5.5.36-rel34.2-    648.precise_i386.deb (--unpack):
 trying to overwrite '/usr/bin/mysqlcheck', which is also in package mysql-client-core-5.5 5.5.35-    0ubuntu0.12.04.2
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/percona-server-client-5.5_1%3a5.5.36-rel34.2-648.precise_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

有人能看出这里发生了什么吗?有没有办法手动安装 mysqldump?或者甚至还有另一种制作转储文件的方法?

答案1

Percona 是 MySQL 的一个分支/替代品,您已为其配置并启用了存储库。您有 2 个选择:

1)删除与 Percona 相关的任何内容,包括 repos,然后安装 MySQL。

2) 删除与 MySQL 相关的所有内容并安装 Percona。也许可以清除 apt 缓存并执行 apt-get update 来尝试修复上一个命令中出现的问题。

相关内容