主題通り、CentOS7からデフォルトデータベースはMariaDBになりました。
正直、DB知識が少なく、今までMariaDBのことはあんまり触れる機会もありませんでした。
少し調べた結果から、MariaDBはMySQLをベースにフォークしたという言い方があります。
そのあとのバージョンアップで、すこしずつ機能と仕様上で、MySQLと異なってきました。
まあ、CentOSはRHELのソースを使って再Buildしたが、MariaDBも最初はそんな感じじゃなかったかな?
今は完全別の製品となってきました。
詳細的な比較はいろんなところで紹介されています。
たとえば、以下のサイトとかを参照してください。詳細はちゃんと見てませんが。
とりあえず、MariaDBを試してみたいと思います。
(1)パッケージのインストール。(rootユーザ)
# yum -y install mariadb-server
読み込んだプラグイン:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: ftp.riken.jp
* extras: ftp.riken.jp
* updates: ftp.riken.jp
依存性の解決をしています
--> トランザクションの確認を実行しています。
---> パッケージ mariadb-server.x86_64 1:5.5.41-2.el7_0 を インストール
--> 依存性の処理をしています: perl-DBI のパッケージ: 1:mariadb-server-5.5.41-2.el7_0.x86_64
--> 依存性の処理をしています: perl-DBD-MySQL のパッケージ: 1:mariadb-server-5.5.41-2.el7_0.x86_64
--> 依存性の処理をしています: perl(Data::Dumper) のパッケージ: 1:mariadb-server-5.5.41-2.el7_0.x86_64
--> 依存性の処理をしています: perl(DBI) のパッケージ: 1:mariadb-server-5.5.41-2.el7_0.x86_64
--> トランザクションの確認を実行しています。
---> パッケージ perl-DBD-MySQL.x86_64 0:4.023-5.el7 を インストール
---> パッケージ perl-DBI.x86_64 0:1.627-4.el7 を インストール
--> 依存性の処理をしています: perl(RPC::PlServer) >= 0.2001 のパッケージ: perl-DBI-1.627-4.el7.x86_64
--> 依存性の処理をしています: perl(RPC::PlClient) >= 0.2000 のパッケージ: perl-DBI-1.627-4.el7.x86_64
---> パッケージ perl-Data-Dumper.x86_64 0:2.145-3.el7 を インストール
--> トランザクションの確認を実行しています。
---> パッケージ perl-PlRPC.noarch 0:0.2020-14.el7 を インストール
--> 依存性の処理をしています: perl(Net::Daemon) >= 0.13 のパッケージ: perl-PlRPC-0.2020-14.el7.noarch
--> 依存性の処理をしています: perl(Net::Daemon::Test) のパッケージ: perl-PlRPC-0.2020-14.el7.noarch
--> 依存性の処理をしています: perl(Net::Daemon::Log) のパッケージ: perl-PlRPC-0.2020-14.el7.noarch
--> 依存性の処理をしています: perl(Compress::Zlib) のパッケージ: perl-PlRPC-0.2020-14.el7.noarch
--> トランザクションの確認を実行しています。
---> パッケージ perl-IO-Compress.noarch 0:2.061-2.el7 を インストール
--> 依存性の処理をしています: perl(Compress::Raw::Zlib) >= 2.061 のパッケージ: perl-IO-Compress-2.061-2.el7.noarch
--> 依存性の処理をしています: perl(Compress::Raw::Bzip2) >= 2.061 のパッケージ: perl-IO-Compress-2.061-2.el7.noarch
---> パッケージ perl-Net-Daemon.noarch 0:0.48-5.el7 を インストール
--> トランザクションの確認を実行しています。
---> パッケージ perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 を インストール
---> パッケージ perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 を インストール
--> 依存性解決を終了しました。
依存性を解決しました
================================================================================
Package アーキテクチャー
バージョン リポジトリー
容量
================================================================================
インストール中:
mariadb-server x86_64 1:5.5.41-2.el7_0 base 11 M
依存性関連でのインストールをします:
perl-Compress-Raw-Bzip2 x86_64 2.061-3.el7 base 32 k
perl-Compress-Raw-Zlib x86_64 1:2.061-4.el7 base 57 k
perl-DBD-MySQL x86_64 4.023-5.el7 base 140 k
perl-DBI x86_64 1.627-4.el7 base 802 k
perl-Data-Dumper x86_64 2.145-3.el7 base 47 k
perl-IO-Compress noarch 2.061-2.el7 base 260 k
perl-Net-Daemon noarch 0.48-5.el7 base 51 k
perl-PlRPC noarch 0.2020-14.el7 base 36 k
トランザクションの要約
================================================================================
インストール 1 パッケージ (+8 個の依存関係のパッケージ)
総ダウンロード容量: 12 M
インストール容量: 59 M
Downloading packages:
(1/9): perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64.rpm | 32 kB 00:00
(2/9): perl-Compress-Raw-Zlib-2.061-4.el7.x86_64.rpm | 57 kB 00:00
(3/9): perl-DBI-1.627-4.el7.x86_64.rpm | 802 kB 00:00
(4/9): perl-DBD-MySQL-4.023-5.el7.x86_64.rpm | 140 kB 00:00
(5/9): perl-IO-Compress-2.061-2.el7.noarch.rpm | 260 kB 00:00
(6/9): perl-Data-Dumper-2.145-3.el7.x86_64.rpm | 47 kB 00:01
(7/9): perl-PlRPC-0.2020-14.el7.noarch.rpm | 36 kB 00:00
(8/9): perl-Net-Daemon-0.48-5.el7.noarch.rpm | 51 kB 00:01
(9/9): mariadb-server-5.5.41-2.el7_0.x86_64.rpm | 11 MB 00:04
--------------------------------------------------------------------------------
合計 2.6 MB/s | 12 MB 00:04
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
インストール中 : perl-Data-Dumper-2.145-3.el7.x86_64 1/9
インストール中 : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 2/9
インストール中 : perl-Net-Daemon-0.48-5.el7.noarch 3/9
インストール中 : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 4/9
インストール中 : perl-IO-Compress-2.061-2.el7.noarch 5/9
インストール中 : perl-PlRPC-0.2020-14.el7.noarch 6/9
インストール中 : perl-DBI-1.627-4.el7.x86_64 7/9
インストール中 : perl-DBD-MySQL-4.023-5.el7.x86_64 8/9
インストール中 : 1:mariadb-server-5.5.41-2.el7_0.x86_64 9/9
検証中 : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 1/9
検証中 : perl-Net-Daemon-0.48-5.el7.noarch 2/9
検証中 : perl-Data-Dumper-2.145-3.el7.x86_64 3/9
検証中 : 1:mariadb-server-5.5.41-2.el7_0.x86_64 4/9
検証中 : perl-PlRPC-0.2020-14.el7.noarch 5/9
検証中 : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 6/9
検証中 : perl-DBI-1.627-4.el7.x86_64 7/9
検証中 : perl-IO-Compress-2.061-2.el7.noarch 8/9
検証中 : perl-DBD-MySQL-4.023-5.el7.x86_64 9/9
インストール:
mariadb-server.x86_64 1:5.5.41-2.el7_0
依存性関連をインストールしました:
perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7
perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7
perl-DBD-MySQL.x86_64 0:4.023-5.el7
perl-DBI.x86_64 0:1.627-4.el7
perl-Data-Dumper.x86_64 0:2.145-3.el7
perl-IO-Compress.noarch 0:2.061-2.el7
perl-Net-Daemon.noarch 0:0.48-5.el7
perl-PlRPC.noarch 0:0.2020-14.el7
(2)サービス起動と状態確認
# systemctl start mariadb
# systemctl status mariadb
mariadb.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled)
Active: active (running) since 土 2015-04-25 20:51:03 JST; 9s ago
Process: 56525 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS)
Process: 56446 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)
Main PID: 56524 (mysqld_safe)
CGroup: /system.slice/mariadb.service
├─56524 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
└─56682 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysq...
4月 25 20:51:01 kakei mariadb-prepare-db-dir[56446]: The latest information...
4月 25 20:51:01 kakei mariadb-prepare-db-dir[56446]: You can find additiona...
4月 25 20:51:01 kakei mariadb-prepare-db-dir[56446]: http://dev.mysql.com
4月 25 20:51:01 kakei mariadb-prepare-db-dir[56446]: Support MariaDB develo...
4月 25 20:51:01 kakei mariadb-prepare-db-dir[56446]: Corporation Ab. You ca...
4月 25 20:51:01 kakei mariadb-prepare-db-dir[56446]: Alternatively consider...
4月 25 20:51:01 kakei mariadb-prepare-db-dir[56446]: http://mariadb.com/kb/...
4月 25 20:51:01 kakei mysqld_safe[56524]: 150425 20:51:01 mysqld_safe Logg....
4月 25 20:51:01 kakei mysqld_safe[56524]: 150425 20:51:01 mysqld_safe Star...l
4月 25 20:51:03 kakei systemd[1]: Started MariaDB database server.
Hint: Some lines were ellipsized, use -l to show in full.
(3)コマンド確認とDBへの接続
ご覧のとおり、コマンドはmysqlのままで、使いかたは一緒です。
# which mysql
/usr/bin/mysql
# mysql -u root
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.41-MariaDB MariaDB Server
Copyright (c) 2000, 2014, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
show databases ;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.00 sec)
MariaDB [(none)]> quit
Bye
(4)インストールされたパッケージは何があるかを確認してみます。
# rpm -qa | grep mariadb
mariadb-5.5.41-2.el7_0.x86_64
mariadb-server-5.5.41-2.el7_0.x86_64
mariadb-libs-5.5.41-2.el7_0.x86_64
詳細な使い方はおいおい確認していきます。
0 件のコメント:
コメントを投稿