欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

ubuntu20.04?安裝?MySQL5.7過程記錄

 更新時間:2022年10月24日 08:47:17   作者:MaxFang  
這篇文章主要介紹了ubuntu20.04?安裝?MySQL5.7過程記錄的相關(guān)資料,需要的朋友可以參考下

背景介紹#

ubuntu 20.04 版本系統(tǒng)自帶的 MySQL 版本是 8.0,普通方法很難安裝 5.7 版本的。由于 8.0 版本較 5.7 版本做了不少改動,筆者比較習(xí)慣使用 5.7 版本。
網(wǎng)上搜做了一圈,跟著各種教程試了很多遍,最后終于找到了成功的方法。過程記錄分享出來,供大家參考。

安裝過程#

筆者的環(huán)境:

root@hz192-168-1.55:/home# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.4 LTS"

若已經(jīng)安裝了 8.0 版本的 MySQL,請先操作刪除。

添加 MySQL 源

sudo vim /etc/apt/sources.list.d/mysql.list

添加如下內(nèi)容,

deb http://repo.mysql.com/apt/ubuntu/ bionic mysql-apt-config
deb http://repo.mysql.com/apt/ubuntu/ bionic mysql-5.7
deb http://repo.mysql.com/apt/ubuntu/ bionic mysql-tools
deb-src http://repo.mysql.com/apt/ubuntu/ bionic mysql-5.7

更新,

sudo apt update

執(zhí)行過程中可能會出現(xiàn)如下錯誤,

W: GPG error: http://repo.mysql.com/apt/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 467B942D3A79BD29
E: The repository 'http://repo.mysql.com/apt/ubuntu bionic InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

執(zhí)行如下命令即可,467B942D3A79BD29根據(jù)實(shí)際情況替換。

root@hz192-168-1-55:/home# sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29

接著再重新執(zhí)行更新,

sudo apt update

安裝 MySQL

查看支持的 MySQL 版本,此處我們已經(jīng)可以看到有 5.7.40-1ubuntu18.04,接近成功了。

root@hz192-168-1-55:/home# sudo apt-cache policy mysql-server
mysql-server:
? Installed: (none)
? Candidate: 8.0.30-0ubuntu0.20.04.2
? Version table:
? ? ?8.0.30-0ubuntu0.20.04.2 500
? ? ? ? 500 http://mirrors.aliyun.com/ubuntu focal-updates/main amd64 Packages
? ? ? ? 500 http://mirrors.aliyun.com/ubuntu focal-security/main amd64 Packages
? ? ?8.0.19-0ubuntu5 500
? ? ? ? 500 http://mirrors.aliyun.com/ubuntu focal/main amd64 Packages
? ? ?5.7.40-1ubuntu18.04 500
? ? ? ? 500 http://repo.mysql.com/apt/ubuntu bionic/mysql-5.7 amd64 Packages

安裝 MySQL 5.7 版本客戶端和服務(wù)端,版本信息根據(jù)上面的輸出自行修改。

sudo apt install mysql-server=5.7.40-1ubuntu18.04
sudo apt install mysql-client=5.7.40-1ubuntu18.04

如無需安裝 mysql-client 服務(wù),執(zhí)行安裝 mysql-server 服務(wù),可能會報如下錯誤。
只需要手動安裝 mysql-community-server 即可。

sudo apt install mysql-community-server=5.7.40-1ubuntu18.04
The following packages have unmet dependencies:
mysql-server : Depends: mysql-community-server (= 5.7.40-1ubuntu18.04) but it is not going to be installed

驗(yàn)證

root@hz192-168-1-55:/home# mysql --version
mysql ?Ver 14.14 Distrib 5.7.40, for Linux (x86_64) using ?EditLine wrapper

ok, 完結(jié)。踩坑君再次填好一個坑,接著去踩下一個啦。

到此這篇關(guān)于ubuntu20.04 安裝 MySQL5.7過程記錄的文章就介紹到這了,更多相關(guān)ubuntu20.04 安裝 MySQL5.7內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評論