Running MySQL 5.7 in Docker

Dont create your support topics here! No new topics with questions allowed!

Moderator: crythias

Post Reply
OTRS newbie
Posts: 7
Joined: 30 Apr 2020, 15:16
OTRS Version?: 6.0
Real Name: Bernhard Schmalhofer

Running MySQL 5.7 in Docker

Post by bschmalhofer »

I wanted to install ((OTRS)) Community Edition on Ubunti 20.04. A problem was that Ubuntu 20.04 ships with MySQL 8 as the default MySQL version. But MySQL 8 is not supported.

Therefore the idea was to spin up a MySQL instance in Docker. Affter some fiddling this seems to work:

Code: Select all

docker run --name otrs-mysql -e MYSQL_ROOT_PASSWORD=XXXXXX -p 3306:3306 -d mysql:5.7.30 --max-allowed-packet=67108864 --innodb-log-file-size=268435456 --character-set-server=utf8 --collation-server=utf8_general_ci
Some things are worth noting.

The port 3306 in the countainer is mapped to 3306 on the host. I could not map to another port as expects the default port. The downside is that I had to shut down the already running MySQL server on the host.

Explicitly passing the mysqld parameters as CMD eliminated the need to adapt the mysql configuration on the host.

The image from DockerHub has a VOLUME declaration for /var/lib/mysql. Therefore an explicit specification is not needed.

When running one can keep as the host.

Post Reply