はじめに
CentOS6にMariaDBを標準インストール
親記事:MySQL, MariaDBの各種インストール方法とEOLまとめ - Qiita
LOG
インストール
# cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)
# yum install -y mariadb-server
... 略
mysql起動/停止
# systemctl start mariadb
# systemctl status mariadb
● mariadb.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
Active: active (running) since Mon 2019-10-21 14:07:07 UTC; 26s ago
Process: 508 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS)
Process: 422 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)
Main PID: 507 (mysqld_safe)
CGroup: /docker/8b752fb5e6e65a4eca06674d46edf07fbf92df7d2d235747a1e0bf79dcce0065/docker/8b752fb5e6e65a4eca06674d46edf07fbf92df7d2d235747a1e0bf79dcce0065/system.slice/mariadb.service
tq507 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
mq675 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/...
? 507 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
Oct 21 14:07:01 8b752fb5e6e6 systemd[1]: Starting MariaDB database server...
Oct 21 14:07:07 8b752fb5e6e6 systemd[1]: Started MariaDB database server.
# systemctl stop mariadb
# systemctl status mariadb
● mariadb.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
Active: inactive (dead)
Oct 21 14:07:01 8b752fb5e6e6 systemd[1]: Starting MariaDB database server...
Oct 21 14:07:07 8b752fb5e6e6 systemd[1]: Started MariaDB database server.
Oct 21 14:07:50 8b752fb5e6e6 systemd[1]: Stopping MariaDB database server...
Oct 21 14:07:51 8b752fb5e6e6 systemd[1]: Stopped MariaDB database server.
mysql自動起動設定/設定解除
# systemctl enable mariadb
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
# systemctl list-unit-files --type=service |grep maria
mariadb.service enabled
# systemctl disable mariadb
Removed symlink /etc/systemd/system/multi-user.target.wants/mariadb.service.
# systemctl list-unit-files --type=service |grep maria
mariadb.service disabled
各種確認
# systemctl start mariadb
# mysql -u root -e'select version();'
+----------------+
| version() |
+----------------+
| 5.5.64-MariaDB |
+----------------+