Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to restart mysql service from mysql docker container

Tags:

bash

docker

mysql

I'm using tommylau/mysql docker image which provides mysql installed.

But after all i can't find how to restart mysql service inside running container (there is no mysql service or /etc/init.d/mysqld)

Any idea how to find how to restart mysql?

like image 281
Serega Belous Avatar asked Oct 25 '18 15:10

Serega Belous


1 Answers

If you log into the container and attempt to restart the service it will essentially kill the container at the point in which the mysql process stops and therefore it'll never start (as the container has exited).

The best way is to simply restart the container using the following command:

docker restart [ContainerID]
like image 62
mtt_g Avatar answered Nov 07 '22 17:11

mtt_g