連接mysql問題
1.在容器內(nèi)mysql正??梢栽L問使用root賬號
root@f4ba8709f955:/bin# /usr/bin/mysql -uroot -p000000
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 10
Server version: 8.0.17 MySQL Community Server - GPL
Copyright (c) 2000, 2019, 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> show databases;
+--------------------+
| Database ? ? ? ? ? |
+--------------------+
| information_schema |
| jpress ? ? ? ? ? ? |
| mysql ? ? ? ? ? ? ?|
| performance_schema |
| sys ? ? ? ? ? ? ? ?|
在宿主機(jī)上無法訪問
tcp46 ? ? ?0 ? ? ?0 ?*.3309 ? ? ? ? ? ? ? ? *.* ? ? ? ? ? ? ? ? ? ?LISTEN ? ??
tcp4 ? ? ? 0 ? ? ?0 ?10.26.92.249.60638 ? ? 10.26.92.249.3309 ? ? ?TIME_WAIT ?
tcp4 ? ? ? 0 ? ? ?0 ?10.26.92.249.60639 ? ? 10.26.92.249.3309 ? ? ?TIME_WAIT ?
tcp4 ? ? ? 0 ? ? ?0 ?10.26.92.249.60640 ? ? 10.26.92.249.3309 ? ? ?TIME_WAIT ?
mysql是啟動的
f4ba8709f955 ? ? ? ?mysql ? ? ? ? ? ? ? "docker-entrypoint.s…" ? 5 minutes ago ? ? ? Up 5 minutes ? ? ? ?33060/tcp, 0.0.0.0:3309->3306/tcp ? brave_dijkstra