It is a good idea to periodically change passwords on your system, especially if you’ve the feeling that they have been shared too much around.
Here we’ll see the correct way to change the MySQL password for the cmon or root user in a database cluster managed by ClusterControl. There’s a script available to change passwords automatically, but if you prefer to do this by hand here’s how.
Notice that versions of ClusterControl starting with 1.2.9 ditched the cmon account and use the root account instead.
Changing the cmon password
On all database nodes and the controller:
mysql> FLUSH PRIVILEGES;
On all database nodes (only if you’re using load balancing via HAProxy), modify the following line in /usr/local/bin/mysqlchk.sh :
On the controller, modify the following line in /etc/cmon.cnf :
and modify the following line in both /var/www/html/clustercontrol/bootstrap.php and /var/www/html/cmonapi/config/database.php:
and finally restart the monitoring daemon:
Changing the root password
On all database nodes and the controller:
mysql> FLUSH PRIVILEGES;
On all database nodes, modify the following line in /etc/my.cnf :
On the controller, modify the following line in /etc/cmon.cnf :
and finally restart the monitoring daemon:
Theoretically you’d need to issue the UPDATE MySQL command only on one node of each cluster (and on the controller) as the change will automatically replicate on all nodes. However it’s always better to play on the safe side.
Obviously n3wp4ssw0rd and r00ts3cr3t are weak passwords — don’t use them.
Laisser un commentaire
Participez-vous à la discussion?N'hésitez pas à contribuer!