Quantcast
Channel: StackExchange Replication Questions
Viewing all articles
Browse latest Browse all 17268

MySQL Replication - How to avoid hard coding MASTER_PASSWORD when achieving Replication setup via automated script?

$
0
0

In many other places, I am achieving it via following command:

mysql --defaults-group-suffix=xxxx -e "SHOW VARIABLES LIKE '%version%';

The actual password is in my.cnf.d/my_custom.cnf but how do I achieve something similar for setting up MASTER command (below):

mysql --defaults-group-suffix=xxxx -Bse "STOP SLAVE;CHANGE MASTER TO MASTER_HOST='$MASTER_IP',MASTER_PASSWORD='HARD_CODED_PASSWORD',MASTER_USER='replicator', MASTER_LOG_FILE='$MASTER_LOG_FILE',MASTER_LOG_POS=$MASTER_LOG_POS;START SLAVE;"

Viewing all articles
Browse latest Browse all 17268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>