Closed Certseeds closed 3 years ago
What's the full docker logs
output? Was the server ready to accept connections at the time?
$ docker run -d --name mysql -e MYSQL_ROOT_PASSWORD=123456 mysql:8.0.22
991278a4537db7b8fa38076017ee1d4a3f1e90d1fb7e9bded4bf1ca74fec4816
$ docker exec -it mysql bash
root@991278a4537d:/# mysql -uroot -p123456 -h 127.0.0.1
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.22 MySQL Community Server - GPL
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
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 that the service in docker need nearly 9 second to be ready for connections
, that is the reason why it cannot connect, thanks.
I found that the service in docker need nearly 9 second to be
ready for connections
, that is the reason why it cannot connect, thanks.
Am getting this error and if you have solved it how did you solved it........
hello, I found that i can not connect with database inside of docker. enviorment is newest docker mysql image,
mysql Ver 8.0.22.
,python3 3.8.3 anaconda
,docker-py
first, I build and start a docker container bythen, i exec a command by
inside the
script.sh
there arebut the output of
output1
is alwaysb"ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)"
is there exists some tricks can Eliminate this error?
PS:link1 this one is useless after test.