LoginSignup
13
11

More than 5 years have passed since last update.

[MariaDB] ubuntuにMariaDBをインストールしてみた

Last updated at Posted at 2013-12-18

Red Hat系にインストールしたかったのだけど
MySQLちゃんがインストールされているとmysql-libsが競合するようなので、
そこらへんに転がってたubuntusくんにインストール。

OSのバージョン
user@ubuntu:~$ cat /etc/os-release
NAME="Ubuntu"
VERSION="12.04.3 LTS, Precise Pangolin"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu precise (12.04.3 LTS)"
VERSION_ID="12.04"
レポジトリの登録
user@ubuntu:~$ sudo vi /etc/apt/sources.list.d/MariaDB.list
deb http://ftp.yz.yamagata-u.ac.jp/pub/dbms/mariadb/mariadb-10.0.6/repo/ubuntu precise main
deb-src http://ftp.yz.yamagata-u.ac.jp/pub/dbms/mariadb/mariadb-10.0.6/repo/ubuntu precise main

ミラーサーバーは、適当なところを探してください。

キーの取得 から インストールまで
user@ubuntu:~$ sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 CBCB082A1BB943DB
user@ubuntu:~$ sudo apt-get update
user@ubuntu:~$ sudo apt-get install mariadb-server-10.0 mariadb-common mariadb-client

このとき、rootパスワードの設定があります。

初期設定
user@ubuntu:~$ sudo mysql_secure_installation
サービス再起動
user@ubuntu:~$ sudo service mysql restart
接続
user@ubuntu:~$ mysql -uroot -p
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 33
Server version: 10.0.6-MariaDB-1~precise-log mariadb.org binary distribution

Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.

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

MariaDB [(none)]> \q
Bye

以上で完了です。

補足(はまったこと)

apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 CBCB082A1BB943DB

で利用するCBCB082A1BB943DBですが
どこに記載されているのかわからず、しばらくはまりましたが

apt-get update をした時点で、ftp.yz.yamagata-u.ac.jp に対するキーが表示されました。
正しいやり方なのかわかりませんが、とりあえずうまく行ってしまった感じです。

13
11
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
13
11