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:
Sameer Naik
2016-02-16 11:45:43 -08:00
parent 3f3da8f454
commit 5dadafae35

View File

@@ -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"