I am trying to initialize the mysql container in Docker by following the command:
docker run --name some-name -e MYSQL_ROOT_PASSWORD=my-password -e MYSQL_DATABASE=db-name mysql/mysql-server
It successfully pulls the container, and when it reaches this line, it stops there and never moves:
2022-02-28T09:10:03.040757Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: Prepare to connect. Version: "8.0.28" Socket: "/var/run/mysqld/mysqld.sock"�%A
The solution I found was to add the following flag:
at the end-it
and add/bin/bash
So the end of the final command looks like this:
-it -d mysql:mysql-server /bin/bash
This will run a terminal in the background of mysql and prevent it from closing. Just I'm hoping someone can correct me if this leads to any future errors, because a%E