LoginSignup
3
5

More than 5 years have passed since last update.

MySQLをMySQL公式aptリポジトリからインストールする

Posted at

目的

Ubuntu 16.04のサーバに
公式のaptリポジトリからMySQL Server(Community版)をインストールする

手順

aptリポジトリ設定用のdebパッケージ入手

https://www.mysql.com/downloads/
にアクセスする。

image

画面下部にあるMySQL Community Editionのダウンロードページに進む
image

遷移先ページの左側、MySQL APT Repositoryのリンクをクリックする
image

ページ下部にあるDownloadリンクをクリックする
image

Oracle OTN?のシングルサインオンのIDおよびパスワードを求められるので、
入力するとdebパッケージがダウンロードされる

aptリポジトリの導入

sudo dpkg -i mysql-apt-config_0.8.7-1_all.deb

まさかのインストール画面。
欲しいのは現在のバージョンのMySQL Serverとその周辺ツールなので
上二つがEnableであることを確認して先に進める。

image

OKと出ればaptリポジトリの設定は完了

以前に未選択のパッケージ mysql-apt-config を選択しています。
(データベースを読み込んでいます ... 現在 59599 個のファイルとディレクトリがインストールされています。)
mysql-apt-config_0.8.7-1_all.deb を展開する準備をしています ...
mysql-apt-config (0.8.7-1) を展開しています...
mysql-apt-config (0.8.7-1) を設定しています ...
OK

MySQL Serverのインストール

sudo apt-get update
sudo apt-get install mysql-server

またもやインストール画面。俺の知ってるものと違う...

image

ひとまずrootパスワードを決めて先に進める。
あとはエラーが出たりしなければ正常にインストールは終わっているはず

MySQL Serverのインストール確認

正常に動作していることが確認できればこれでOK。

$ sudo service mysql status
● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: active (running) since 土 2017-07-29 16:36:40 JST; 49s ago
 Main PID: 4965 (mysqld)
   CGroup: /system.slice/mysql.service
           └─4965 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid

 7月 29 16:36:38 mysql systemd[1]: Starting MySQL Community Server...
 7月 29 16:36:40 mysql systemd[1]: Started MySQL Community Server.

ログインしてみて動作確認。

$ mysql -uroot -pパスワード
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.19 MySQL Community Server (GPL)

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

問題なさそう。

3
5
1

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
3
5