自从我将系统升级到 20.04 后,mysqldiff 就丢失了。我找到了这个包: https://manpages.ubuntu.com/manpages/focal/en/man1/mysqldiff.1.html 但是如果我尝试使用 apt 安装它,它却找不到它。
sudo apt install mysql-utilities
apt 未找到其依赖项:python-mysql.connector(>= 1.2.1) https://launchpad.net/ubuntu/focal/amd64/mysql-utilities/1.6.4-1
当我尝试搜索 mysql-utilities 时,它显示:
$ apt-cache search mysql-utilities
libmysql-diff-perl - module for comparing the table structure of two MySQL databases
我也尝试安装 libmysql-diff-perl(可能和以前一样)但没有可用的 mysqldiff 命令。
有人遇到过同样的问题吗?
答案1
由于 Python 2 已弃用,此软件包不适用于 20.04 LTS,但您仍然可以使用 19.10 中的软件包进行安装:
mkdir -p ~/Downloads/mysqldiff
cd ~/Downloads/mysqldiff
wget http://old-releases.ubuntu.com/ubuntu/pool/universe/p/python-nacl/python-nacl_1.3.0-2_amd64.deb
wget http://old-releases.ubuntu.com/ubuntu/pool/universe/p/pyodbc/python-pyodbc_4.0.22-1build2_amd64.deb
wget http://old-releases.ubuntu.com/ubuntu/pool/universe/p/paramiko/python-paramiko_2.6.0-1_all.deb
wget http://old-releases.ubuntu.com/ubuntu/pool/universe/a/antlr4-cpp-runtime/libantlr4-runtime4.7.2_4.7.2+dfsg-1_amd64.deb
wget http://old-releases.ubuntu.com/ubuntu/pool/main/p/poppler/libpoppler90_0.80.0-0ubuntu1_amd64.deb
wget http://old-releases.ubuntu.com/ubuntu/pool/universe/n/netcdf/libnetcdf13_4.6.2-1build1_amd64.deb
wget http://old-releases.ubuntu.com/ubuntu/pool/universe/p/proj/libproj13_5.2.0-1_amd64.deb
wget http://old-releases.ubuntu.com/ubuntu/pool/universe/libg/libgeotiff-dfsg/libgeotiff2_1.4.3-1_amd64.deb
wget http://old-releases.ubuntu.com/ubuntu/pool/universe/g/gdal/gdal-data_2.4.2+dfsg-1build2_all.deb
wget http://old-releases.ubuntu.com/ubuntu/pool/universe/g/gdal/libgdal20_2.4.2+dfsg-1build2_amd64.deb
wget http://old-releases.ubuntu.com/ubuntu/pool/universe/m/mysql-connector-python/python-mysql.connector_8.0.15-1_all.deb
wget http://old-releases.ubuntu.com/ubuntu/pool/universe/m/mysql-workbench/mysql-workbench-data_8.0.17+dfsg-1ubuntu2_all.deb
wget http://old-releases.ubuntu.com/ubuntu/pool/universe/m/mysql-workbench/mysql-workbench_8.0.17+dfsg-1ubuntu2_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/m/mysql-utilities/mysql-utilities_1.6.4-1_all.deb
sudo apt-get update
sudo apt-get install ./*.deb
然后固定 libgdal 包以防止删除刚刚安装的包:
cat <<EOF | sudo tee /etc/apt/preferences.d/pin-gdal
Package: gdal-data
Pin: version 2.4.2+dfsg-1build2
Pin-Priority: 1337
Package: libgdal20
Pin: version 2.4.2+dfsg-1build2
Pin-Priority: 1337
EOF
享受:
$ mysqldiff --version MySQL Utilities mysqldiff version 1.6.4 License type: GPLv2
您还将获得mysql-workbench
依赖项和免费奖励的安装:)