我已经安装了 Ubuntu 18.04。
我想要安装 mysql 服务器版本 5.6,但是apt-get
显示将安装版本 5.7:
apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libaio1 libcgi-fast-perl libcgi-pm-perl libedit2 libencode-locale-perl libevent-core-2.1-6 libfcgi-perl libgdbm-compat4 libgdbm5 libhtml-parser-perl
libhtml-tagset-perl libhtml-template-perl libhttp-date-perl libhttp-message-perl libio-html-perl liblwp-mediatypes-perl libnuma1 libperl5.26
libtimedate-perl liburi-perl libwrap0 mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server-5.7 mysql-server-core-5.7 netbase perl
perl-modules-5.26 psmisc
Suggested packages:
gdbm-l10n libdata-dump-perl libipc-sharedcache-perl libwww-perl mailx tinyca perl-doc libterm-readline-gnu-perl | libterm-readline-perl-perl make
The following NEW packages will be installed:
libaio1 libcgi-fast-perl libcgi-pm-perl libedit2 libencode-locale-perl libevent-core-2.1-6 libfcgi-perl libgdbm-compat4 libgdbm5 libhtml-parser-perl
libhtml-tagset-perl libhtml-template-perl libhttp-date-perl libhttp-message-perl libio-html-perl liblwp-mediatypes-perl libnuma1 libperl5.26
libtimedate-perl liburi-perl libwrap0 mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server mysql-server-5.7 mysql-server-core-5.7 netbase
perl perl-modules-5.26 psmisc
0 upgraded, 31 newly installed, 0 to remove and 7 not upgraded.
Need to get 27.8 MB of archives.
After this operation, 204 MB of additional disk space will be used.
如何强制安装 mysql 5.6 版本?
答案1
命令是
sudo apt-get install mysql....5.6
在互联网上查找确切的命令并在命令行中发出它。
如果您使用 GUI,请使用软件管理器来搜索并安装您需要的软件。
我认为您需要安装 MariaDB,因为它得到了一些 Linux 发行版的官方支持。在这些发行版中,您将无法在其支持的软件列表中找到 MySql。
答案2
您可以尝试在 docker 容器中运行 mysql 5.6,例如:
sudo docker run -d --name=mysql56 -e MYSQL_ROOT_PASSWORD='12345' -p 3356:3306 mysql:5.6
并与客户核对:
echo "SELECT VERSION()" | mysql -hlocalhost -uroot -p12345 -P3356 --protocol=tcp
印刷:
VERSION()
5.6.44