MySQL Service timezone different than Host Timezone

I have successfully installed xibo to run with docker in my remote server. However after installation I noticed that the current time of MySQL (I simply performed a SELECT NOW()) is different than the one I get executing a “date” command on Ubuntu. Is there a way to configure the docker-compose.yml to handle this configuration? Perhaps through an environmental variable MYSQL_TZ or something similar?

You can simply add a MYSQL_TZ variable to your config.env file I believe in that case - assuming that the MySQL container is setup to expect that.

You’d then need to run docker-compose down, then docker-compose up -d to have it pull those changes through.

I don’t believe MySQL’s container is listening for MYSQL_TZ.

Instead, I think you need to pass in just TZ:

Thanks alex! I just tried it and it worked perfectly! Have a nice day!

1 Like