Last-modified: 2014-08-10 (日) 01:45:34
MariaDB/Debianへのインストール

概要

MariaDBをパッケージから導入します。
Debianのリポジトリにはないので、MariaDB公式サイトの手順に従います。

手順

  1. 前準備
    Everything is expanded.Everything is shortened.
      1
      2
      3
    
     
     
     
    
    apt-get install python-software-properties
    apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
    add-apt-repository 'deb http://ftp.yz.yamagata-u.ac.jp/pub/dbms/mariadb/repo/5.5/debian wheezy main'
  2. インストール
    Everything is expanded.Everything is shortened.
      1
      2
    
     
     
    
    apt-get update
    apt-get install mariadb-server-5.5
  3. ログインします。
    Everything is expanded.Everything is shortened.
      1
      2
    
    -
    !
    
    # パスワードを聞かれるので、インストール時に設定した値を入力
    mysql -u root -p
  4. ログアウトします。
    Everything is expanded.Everything is shortened.
      1
    
     
    
    exit

インストール出来ない場合

MySQL5.5が入っているところから消して入れようとしたら、apt-get installが失敗しました。
以下の手順で入りました。
MySQL5.5を削除しているので、データベースとmy.cnfのバックアップを行ってから作業します。

Everything is expanded.Everything is shortened.
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
-
!
 
 
 
 
-
!
 
 
-
|
!
 
-
!
 
 
-
!
 
-
!
# 削除
apt-get --purge autoremove mysql-*
apt-get --purge autoremove mariadb*
rm -rf /var/lib/mysql
rm -rf /etc/mysql
 
# ゴミがないか確認
dpkg -l | grep -i mysql
dpkg -l | grep -i mariadb
 
# このときは再起動しないと失敗
# 保留状態のパッケージなどはなかったが
reboot
 
# キャッシュクリアと取得
apt-get clean
apt-get update
 
# 何もないことを一応確認
apt-get upgrade
 
# インストール
apt-get install mariadb-server-5.5

検証時の環境