Permalink
Browse files

IFSを元に戻す

  • Loading branch information...
cohalz committed Dec 8, 2018
1 parent 6b00400 commit d2ce9607b803219b7c273563dfd95800ce2c200e
Showing with 2 additions and 0 deletions.
  1. +2 −0 prepare.sh
@@ -27,9 +27,11 @@ done

# (3) Masterにレプリケーション用のユーザーと権限の作成
IP=`hostname -i`
OLDIFS=$IFS
IFS='.'
set -- $IP
SOURCE_IP="$1.$2.%.%"
IFS=$OLDIFS
mysql -h $MYSQL_MASTER_HOST -u root -p$MYSQL_ROOT_PASSWORD -e "CREATE USER IF NOT EXISTS '$MYSQL_REPL_USER'@'$SOURCE_IP' IDENTIFIED BY '$MYSQL_REPL_PASSWORD';"
mysql -h $MYSQL_MASTER_HOST -u root -p$MYSQL_ROOT_PASSWORD -e "GRANT REPLICATION SLAVE ON *.* TO '$MYSQL_REPL_USER'@'$SOURCE_IP';"

0 comments on commit d2ce960

Please sign in to comment.