Hi, I’m Danilo Martins, I’m working with Docker and I have a Mysql database container, I installed it as docker-composer below but my mysql container is only in Restarting mode. I do not know what to do anymore …
I guess that there is a problem inside your DB container, that makes the mysql process stop. That causes the container to shutdown. Because of ‘restart: always’, it always tries to restart again.
To find the problem you can: docker logs -f <db_container_name>
This will give you the logs of this container, probably including what mysql is doing and its errors. If you need help interpreting the logs, you could post them here. I hope I can come back to your problem.
Hello friends, I had the same problem.
I’ll share how I solved it:
As I am using docker-compose , I ran the command in the terminal: docker-compose up
And I observed the log that returned the following error:
dashboard-mysql | error: database is uninitialized and password option is not specified
dashboard-mysql | You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD
And I found that the database password was missing. I added this information and made a new build. And now it’s working.