LoginSignup
1
2

More than 5 years have passed since last update.

[MariaDB][外付けHDD][CentOS7]CentOS7+MariaDB+外付けHDD

Posted at

外付けHDDをマウント

フォーマット

こちらのサイトで。
http://mrs.suzu841.com/mini_memo/numero_13.html

再起動後も維持

こちらのサイトで。
http://kazmax.zpp.jp/linux_beginner/mount_hdd.html#ah_4

MariDBのデータディレクトリの変更

データディレクトリ変更
 変更元
  /var/lib/mysql/
 変更先
  /data/mariadb/

MariaDB停止

・停止実行
systemctl stop mariadb
・停止確認
systemctl status mariadb

データコピー

cp -pR /var/lib/mysql/* /data/mariadb/

設定ファイル変更

vi /etc/my.cnf

[mysqld]
#datadir=/var/lib/mysql これを下記へ変更。
datadir=/data/mariadb/
#socket=/var/lib/mysql/mysql.sock これを下記へ変更。
socket=/data/mariadb/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d

MariaDB起動

・起動
systemctl start mariadb
・起動確認
systemctl status mariadb

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2