Setup
On master:
CREATE USER 'replication_user'@'%' IDENTIFIED BY 'c2Z3UBzHXWQOhCsW5w21f9AmILacxyM2dyGiBuagTKSzycbHesCtwANLhdNH5NON7RvumausDlLLiQ6m';
|
GRANT REPLICATION SLAVE ON *.* TO 'replication_user'@'%';
|
FLUSH PRIVILEGES;
|
On slave:
STOP SLAVE;
|
CHANGE MASTER TO
|
MASTER_USER='replication_user', MASTER_PASSWORD='c2Z3UBzHXWQOhCsW5w21f9AmILacxyM2dyGiBuagTKSzycbHesCtwANLhdNH5NON7RvumausDlLLiQ6';
|
START SLAVE;
|
After this, the replication is working.
Problem
To produce the isse, restart the server:
sudo service mariadb restart
Now, "SHOW SLAVE STATUS \G" shows:
...
Last_IO_Error: error connecting to master 'replication_user@molde.fire.smil:3306' - retry-time: 10 maximum-retries: 100000 message: Access denied for user 'replication_user'@'fdb6:6d27:be73:4::65' (using password: YES)
...
Reason:
sudo strings /var/lib/mysql/master.info
...
replication_user
c2Z3UBzHXWQOhCsW5w21f9AmILacxyM2dyGiBuagT
...
=> The password has been truncated to 32 characters when stored in master.info. A restart of the server retrieves the truncated password, which obviously does not work.
Work-around
Using a 32-character password. This weakens security!
|