When I try to create a two node MariaDB cluster in Docker on Windows, I get this error:

ERROR 1396 (HY000) at line 8: Operation CREATE USER failed for 'root'@'%'

For the first node I run this

docker run --network maria_db --name maria-0 -e MYSQL_INITDB_SKIP_TZINFO=yes -e MYSQL_ALLOW_EMPTY_PASSWORD=yes mariadb --wsrep-new-cluster --wsrep_cluster_address=gcomm://maria-0,maria-1 --binlog-format=ROW --wsrep-on=1 --wsrep-provider=/usr/lib/galera/libgalera_smm.so

And wait until it is ready for connections, then I open up a new terminal and run this:

docker run --network maria_db --name maria-1 -e MYSQL_INITDB_SKIP_TZINFO=yes -e MYSQL_ALLOW_EMPTY_PASSWORD=yes mariadb --wsrep_cluster_address=gcomm://maria-0,maria-1 --binlog-format=ROW --wsrep-on=1 --wsrep-provider=/usr/lib/galera/libgalera_smm.so

I have tried to set a root password, but I get the same output.

The log for node two is pretty big, so i have created a pastebin: https://pastebin.com/dp85mpPg. I have tried to embed this log in this question, but it seems to not be possible to do so without linebreaking.

I really dont know what is causing this, but it maybe looks like the image tries to recreate the database on node two after it has synced the database? I dont know. This is new to me,

Hope someone knows what to do.

  • Basically this cant get to work on Windows because of a bug in volume mounts. The work around on Linux and Mac is to create a volume with a already created mysql folder for the data on all nodes, so the init does not happen. This cant be done on windows. I am left wtih two options: 1) picking another database for my project, or 2) waiting :( both makes me sad. – mslot Oct 10 '18 at 20:20

I have done it myself as part of something I call stack, https://github.com/mslot/stack. Build the Maria database image. It uses a consul as discovery tool.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.