2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Ubuntu20.04にMySQL5.7をインストールする

Last updated at Posted at 2024-12-24

仕事上、必要になったので、仕方がなくMySQL5.7をインストールすることに。それとPHPが5.6系。

おそらく2024年12月だけしか使えないと思われる。

Ubuntu 20.04 と PHP5.6

Ubuntu18.04はOndrejさんがサポート外とのこと。
なのでUbuntu20.04を選択。

いつものPHPインストールでPHP5.6を設定。

MySQL5.7

◆まずは、このブログ「UbuntuでMySQL 5.7をインストールする方法」を参考にインストールを進める。

だが、途中で動かなくなってしまった。

◆仕方がないので、今度はこちらのエントリー「Is it possible to install MySQL Server 5.7 on Ubuntu 19.10?」を参考にして作業。

下記ファイルを直接修正した。

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

書き込む内容は、こちら。

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 http://repo.mysql.com/apt/ubuntu/ bionic mysql-tools-preview
deb-src http://repo.mysql.com/apt/ubuntu/ bionic mysql-5.7

◆そしてsudo apt update

◆エラーメッセージから、こちらのブログ「public key is not available: NO_PUBKEY」を参考にして下記を実行

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys <PUB_KEY>

◆最後にインストールできたかを確認

$ sudo apt-cache policy mysql-server
$ mysql --version

ひとまず動いた。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?