Shell script `default/mysql-clustermin'

Add a clustermin user with root privileges into MySQL user.
MySQL 'root' must not have a password. It'll be changed to some random password and never seen again.

{% set randomPassword = randomize('clm_password' ~ (cluster.uuid ? : server.id)) %} echo " CREATE USER 'clustermin'@'%' IDENTIFIED BY '{{ randomPassword }}'; GRANT ALL PRIVILEGES ON *.* TO 'clustermin'@'%' WITH GRANT OPTION; FLUSH PRIVILEGES; " | sudo mysql echo " [client] user=clustermin password={{ randomPassword }} " > $HOME/.my.cnf chmod 0600 $HOME/.my.cnf echo "SET PASSWORD FOR root@localhost=PASSWORD('{{ randomString(32) }}');" | mysql