mirror of
https://github.com/bitnami/containers.git
synced 2026-03-20 23:10:53 +08:00
fix creation of replication user for 10.x releases
Creating a replication user (in the `GRANT` statement) without a password errors out on upcoming 10.x releases. For example, ```sql GRANT REPLICATION SLAVE ON *.* TO 'replication'@'%' IDENTIFIED BY ''; ``` emits the error `ERROR 1133 (28000): Can't find any matching row in the user table`. To resolve this we user the `CREATE` statement to the user. eg. ```sql CREATE USER 'replication'@'%' IDENTIFIED BY ''; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'%'; ```
This commit is contained in:
@@ -72,7 +72,8 @@ configure_replication() {
|
||||
echo "==> Creating replication user $MARIADB_REPLICATION_USER..."
|
||||
echo ""
|
||||
|
||||
echo "GRANT REPLICATION SLAVE ON *.* TO '$MARIADB_REPLICATION_USER'@'%' IDENTIFIED BY '$MARIADB_REPLICATION_PASSWORD';" >> /tmp/init_mysql.sql
|
||||
echo "CREATE USER '$MARIADB_REPLICATION_USER'@'%' IDENTIFIED BY '$MARIADB_REPLICATION_PASSWORD' ;" >> /tmp/init_mysql.sql
|
||||
echo "GRANT REPLICATION SLAVE ON *.* TO '$MARIADB_REPLICATION_USER'@'%' ;" >> /tmp/init_mysql.sql
|
||||
echo "FLUSH PRIVILEGES ;" >> /tmp/init_mysql.sql
|
||||
else
|
||||
echo "In order to setup a replication master you need to provide the MARIADB_REPLICATION_USER as well"
|
||||
|
||||
Reference in New Issue
Block a user