reconfig mysql replication
This commit is contained in:
@@ -1,8 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
exec > >(tee -i /tmp/test.log)
|
||||
|
||||
exec 2>&1
|
||||
|
||||
bases="amavis iredadmin iredapd roundcubemail"
|
||||
|
||||
|
||||
for i in $bases; do
|
||||
echo some users param with "very interesting string '$i' and other"
|
||||
done
|
||||
MYSQL_ROOT_USER=root
|
||||
MYSQL_ROOT_PASSWD=123qweASD
|
||||
MYSQL_MASTER_ADDRESS=172.17.5.31
|
||||
MYSQL_SLAVE_USER_PASSWD=123qweASD
|
||||
|
||||
/usr/bin/mysql --user=$MYSQL_ROOT_USER --password=$MYSQL_ROOT_PASSWD \
|
||||
--host=$MYSQL_MASTER_ADDRESS \
|
||||
--execute="GRANT REPLICATION SLAVE ON *.* TO 'slave_user'@'%'\
|
||||
IDENTIFIED BY $MYSQL_SLAVE_USER_PASSWD; FLUSH PRIVILEGES;"
|
||||
|
||||
/usr/bin/mysql --user=$MYSQL_ROOT_USER --password=$MYSQL_ROOT_PASSWD \
|
||||
--host=$MYSQL_MASTER_ADDRESS --execute="SHOW DATABASES;"
|
||||
|
||||
Reference in New Issue
Block a user