docker-library / mysql

Docker Official Image packaging for MySQL Community Server
https://dev.mysql.com/
GNU General Public License v2.0
2.42k stars 2.18k forks source link

Enviroment variable don't support multi instance #1025

Closed wck821829906 closed 5 months ago

wck821829906 commented 5 months ago

when I use command line docker run -d --net=host --name mysql -e MYSQL_ROOT_PASSWORD=123456 -e MYSQL_DATABASE="db1,db2,db3" mysql:5.7, the result is just one instance created but not multiple instance as db1、db2、db3

image
tianon commented 5 months ago

That is correct -- we intentionally only support creation of a single database with MYSQL_DATABASE. More complex use cases are encouraged to create a small .sql or .sh script in the supported initdb folder.