LoginSignup
0
0

More than 5 years have passed since last update.

Vagrant + Ubuntu Trusty で MySQL 5.7 を入れたい

Last updated at Posted at 2016-12-02

基本的には下記URLの通り
http://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/#repo-qg-apt-repo-manual-setup

su してる前提で provision 関連のファイルに突っ込んだ。

MySQL GPG Public Key を apt-key add する

Download the MySQL GPG Public key (see Signature Checking Using GnuPG on how to do that) and save it to a file, without adding any spaces or special characters. Then, add the key to your system's GPG keyring with the following command:
shell> sudo apt-key add path/to/signature-file

もしくは pgp.mit.edu で入手する手も。

Alternatively, you can download the GPG key to your APT keyring directly using the apt-key utility:
shell> sudo apt-key adv --keyserver pgp.mit.edu --recv-keys 5072E1F5

めんどいので後者にした。

% apt-key adv --keyserver pgp.mit.edu --recv-keys 5072E1F5

Ubuntu のバージョンにあった MySQL のレポジトリを登録する

Create a file named /etc/apt/sources.list.d/mysql.list, and put into it repository entries in the following format:
deb http://repo.mysql.com/apt/{debian|ubuntu}/ {jessie|wheezy|precise|trusty|utopic|vivid} {mysql-5.6|mysql-5.7|workbench-6.2|utilities-1.4|connector-python-2.0}

% echo "deb http://repo.mysql.com/apt/ubuntu/ trusty mysql-5.7" | tee /etc/apt/sources.list.d/mysql.list

apt-get install

あとは普通にインストール

% apt-get update
% apt-get install -y mysql-server

まとめ

ということで provision のファイルに下記を追加した。

# via. http://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/#repo-qg-apt-repo-manual-setup
apt-key adv --keyserver pgp.mit.edu --recv-keys 5072E1F5
echo "deb http://repo.mysql.com/apt/ubuntu/ trusty mysql-5.7" | tee /etc/apt/sources.list.d/mysql.list
apt-get update
apt-get install -y mysql-server

感想

最初 mysql-apt-config_0.X.X-X_all.deb ファイルをダウンロードして紫背景の設定画面を操作するマニュアルなインストール方法しか見つけられなくてハマった。

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