5
5
5exi2020-10-20 11:27:46
MySQL
5exi, 2020-10-20 11:27:46

How to run mysql in docker with port forwarding?

Ubuntu 20.04
According to the manuals, everything is simple:
docker pull mysql/mysql-server:5.7.31
docker run --name mysql -d mysql/mysql-server:5.7.31
This is how it works.
But as soon as: docker run --name mysql -e MYSQL_ROOT_PASSWORD=root -d mysql/mysql-server:5.7.31 -it -p 33060:3306
[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.
The container won't start.
docker events does not display any intelligible errors.
Where to look?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zohan1993, 2020-10-20
@5exi

docker run -d --name mysql -p 33060:3306 -e MYSQL_ROOT_PASSWORD=root mysql/mysql-server:5.7.31

You have the wrong order of parameters in the run command.
When using exec mode for ENTRYPOINT, CMD arguments are appended at the end.
Anything after the image name in the docker run command overrides the CMD instruction.
Dockerfile

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question