docker install mysql

Scroll Down

Simply record configuration file

docker run \
--name mysql -d \
-v /opt/docker/mysql/data:/var/lib/mysql \
-v /opt/docker/mysql/conf:/etc/mysql/conf.d \
-e MYSQL_ROOT_PASSWORD=password \
-p 3306:3306 \
mysql \
--character-set-server=utf8mb4 \
--collation-server=utf8mb4_unicode_ci