Closed shiack closed 4 months ago
There are probably some useful logs on the container that are worth checking. It's also worth noting that you likely don't want to run MySQL with --privileged
(that would mean that any compromise of your database container is also a 100% definitely compromised host).
My attempt to reproduce a failure was unsuccessful: :sweat_smile:
$ docker run -d -e MYSQL_ROOT_PASSWORD=1234 --pull=always --name mysql mysql:5.7
5.7: Pulling from library/mysql
20e4dcae4c69: Pull complete
1c56c3d4ce74: Pull complete
e9f03a1c24ce: Pull complete
68c3898c2015: Pull complete
6b95a940e7b6: Pull complete
90986bb8de6e: Pull complete
ae71319cb779: Pull complete
ffc89e9dfd88: Pull complete
43d05e938198: Pull complete
064b2d298fba: Pull complete
df9a4d85569b: Pull complete
Digest: sha256:4bc6bc963e6d8443453676cae56536f4b8156d78bae03c0145cbe47c2aad73bb
Status: Downloaded newer image for mysql:5.7
a1f785751f104a9844bfa0a36781b4ea09a110fbda5263d8764731de1d4f976b
$ docker logs --tail=2 mysql
2024-02-21T23:18:21.064228Z 0 [Note] mysqld: ready for connections.
Version: '5.7.44' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL)
$ docker exec -it mysql mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.44 MySQL Community Server (GPL)
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
I found the missing configuration, now it is working. Very helpful advice
Nice, glad you got it figured!
Any help will be appreciated
After the container first runs, it fails to connect to the server:
The error encountered:
After trying to change the configuration, it can connect:
However, when tried to set replication node:
it will still fail :
and also, result of following command is emty: