CentOS7では、「MySQL」がデフォルトのデータベースでは無く、MySQLから派生した「MariaDB」がデフォルトのデータベースのようですので、VMwareFusion 6.04 にインストールしたCentOS 7.0に「MariaDB」をインストールしました。
- yumコマンドでmariadbをインストールしました。
# yum install mariadb mariadb-server
- mariadbは以下のものがインストールされました。
# yum list installed | grep mariadb
mariadb.x86_64 1:5.5.37-1.el7_0 @updates
mariadb-libs.x86_64 1:5.5.37-1.el7_0 @updates
mariadb-server.x86_64 1:5.5.37-1.el7_0 @updates
- mysqlのバージョンとしては、5.5.37になるようです。
# mysql --version
mysql Ver 15.1 Distrib 5.5.37-MariaDB, for Linux (x86_64) using readline 5.1
- mariadbのサービスを起動しました。
# systemctl start mariadb.service
- mariadbサービスの登録状態を確認しました。mariadbは起動時サービスとして登録されていませんでした。
# systemctl list-unit-files | grep mariadb
mariadb.service disabled
- mariadbを起動時サービスとして登録しました。
# systemctl enable mariadb.service
- mariadbサービスの登録状態が「enabled 」になったことを確認しました。
# systemctl list-unit-files | grep mariadb
mariadb.service enabled
- 「mysql_secure_installation」コマンドでmariadbの初期設定(rootパスワードの設定)を行いました。
# mysql_secure_installation
:
Enter current password for root (enter for none): (入力:enter)
Set root password? [Y/n] (入力:enter)
New password: (入力:rootパスワード)
Re-enter new password: (再入力:rootパスワード)
Remove anonymous users? [Y/n] (mysql 入力:enter)
Disallow root login remotely? [Y/n] (入力:enter)
Remove test database and access to it? [Y/n] (入力:enter)
Reload privilege tables now? [Y/n] (入力:enter)
:
#
- 設定したrootパスワードでアクセスできることを確認し、mariadbのインストールを終了しました。
# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
#
# mysql -uroot -p
Enter password: (設定したrootパスワード)
Welcome to the MariaDB monitor. Commands end with ; or g.
Your MariaDB connection id is 14
Server version: 5.5.37-MariaDB MariaDB Server
Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
MariaDB [(none)]> quit;
Bye
#