colinmollenhour / mariadb-galera-swarm

MariaDb Galera Cluster container based on official mariadb image which can auto-bootstrap and recover cluster state.
https://hub.docker.com/r/colinmollenhour/mariadb-galera-swarm
Apache License 2.0
223 stars 102 forks source link

root account handling seems incorrect #73

Closed lneva-fastly closed 5 years ago

lneva-fastly commented 5 years ago

The logic for creating the root user seems incorrect: https://github.com/colinmollenhour/mariadb-galera-swarm/blob/7a8241273b07f3a88198940ef03b7ef550e4c200/start.sh#L225-L237

It looks like 'root'@'127.0.0.1' is created in any case, and password-less socket access is allowed if the MYSQL_ROOT_SOCKET_AUTH variable is set to 0 (which should disable it). Otherwise the 'root'@'127.0.0.1' user is redundantly created again.

I hadn't noticed MYSQL_ROOT_SOCKET_AUTH and just assumed that mariadb-galera-swarm always created the passwordless socket-only root user, which is super-convenient. I have /var/run/mysqld on a volume shared with another container that handles backups. Very smooth. My concern is that just fixing the logic here could break existing use cases (like mine), so messaging about the change would be important.

colinmollenhour commented 5 years ago

Oops.. I think I must have started = "1" and then changed my mind and wanted to reverse it so it was the default. As it only affects seeding new databases I think it is best to just get it fixed asap. I think I'll add a note to the README about upgrading advising to read the commit log before upgrading since it is impossible to control breaking changes due to MariaDb instability.

lneva-fastly commented 5 years ago

Oh, good point. Thanks for the quick fix!