0
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?

More than 1 year has passed since last update.

Ubuntu22.04(WSL2)環境にMySQLをインストール

Posted at

前提

WSL2環境にUbuntu22.04 がインストール済みであるものとする。
参考:UBuntu 22.04 をWSL2 環境で動かすメモ

MySQLのインストール

MySQLのどのバージョンをインストールすればいいのかを下記サイトにて調べる。
Supported Platforms: MySQL Database
MySQL_version.png
次はバージョン8.0に対応するパッケージ名を調べる。

$ sudo apt-cache search mysql # "mysql" が含まれるパッケージ一覧を表示
# 検索結果が多いのでコマンド出力結果をgrepする
# 正規表現=^mysql-* として、文頭が"mysql-" のものに絞る
sudo apt-cache search mysql | grep -e ^mysql-*

検索結果は下記の通り。
インストールパッケージ一覧検索(mysql).png
今回は mysql-server-8.0 をインストールする。

$ sudo apt update # パッケージ一覧の更新
$ sudo apt install mysql-server-8.0 -f

インストールできたことを確認する。

$ mysql --version

参考

apt-cache コマンド:apt-getでインストール可能なパッケージを探すには
grepコマンドの詳細まとめました【Linuxコマンド集】
MySQL 8.0 を Ubuntu 22.04 にインストールする

0
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
0
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?