5.2 データベースインストール



# yum -y install mariadb-server

# rpm -qa | grep mariadb
mariadb-5.5.56-2.el7.x86_64
mariadb-libs-5.5.56-2.el7.x86_64
mariadb-server-5.5.56-2.el7.x86_64

# systemctl start mariadb
# systemctl enable mariadb
# systemctl status mariadb
● mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
   Active: active (running) since 水 2019-03-21 11:43:56 JST; 26s ago

# mysql_secure_installation

<省略>

Set root password? [Y/n] Y       ←「Y」を入力
New password: dbpass   ←rootのパスワードを入力
Re-enter new password: dbpass    ←rootのパスワードを再入力
Password updated successfully!
Reloading privilege tables..
... Success!

<省略>

Thanks for using MariaDB!
#

# mysql -u root -p
Enter password: dbpass           ←rootのパスワードを入力
MariaDB > create database bacula;   ←createコマンドを実行
Query OK, 1 row affected (0.00 sec)
MariaDB > grant all privileges on bacula.* to bacula@localhost identified by 'dbpass';
Query OK, 0 rows affected (0.01 sec)           MariaDBのパスワード設定↑
MariaDB > quit
Bye