"Cannot initialize when running mysql-server in Docker"
P粉959676410
P粉959676410 2024-03-26 16:53:57
0
1
345

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
P粉959676410
P粉959676410

reply all(1)
P粉810050669

The solution I found was to add the following flag:

-it and add /bin/bash

at the end

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template