在Docker容器和MySQL Workbench中与Mariadb的连接
我使用以下命令创建了一个正在运行MariaDB的Docker容器:
docker run -d --name some-mariadb -p 3306:3306 -e MARIADB_USER=example-user -e MARIADB_PASSWORD=<enter password> -e MARIADB_ROOT_PASSWORD=<enter password> mariadb
在将iPaddress放入iPaddress时,我无法成功测试MySQL Workbench中的连接(通过在下面运行Docker命令找到它)以及用户(示例 - 用户)和密码(尝试了MaridB_Password和Mariadb_root_password的密码)。
我得到的只是“无法连接到主机”
docker命令获取iPaddress:
docker container inspect some-mariadb
请注意,当我在下面运行命令时,我可以看到Mariadb [(none)]&gt;终端。
docker exec -it some-mariadb mysql -u example-user -p
I created a docker container that's running MariaDb using the command below:
docker run -d --name some-mariadb -p 3306:3306 -e MARIADB_USER=example-user -e MARIADB_PASSWORD=<enter password> -e MARIADB_ROOT_PASSWORD=<enter password> mariadb
I'm not able to successfully test the connection in mysql workbench when putting in the IPAddress (found it by running the docker command below) along with the user (example-user) and password (tried the passwords for MARIDB_PASSWORD and MARIADB_ROOT_PASSWORD).
All I get is "unable to connect to host"
Docker command to get IPAddress:
docker container inspect some-mariadb
Note that when I run the command below I am able to see the MariaDB [(none)]> terminal.
docker exec -it some-mariadb mysql -u example-user -p
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我能够使用Localhost(127.0.0.1)IP地址创建连接。用户和Mariadb_root_password没有问题。
I was able to create a connection using the localhost (127.0.0.1) IP address. The user and MARIADB_ROOT_PASSWORD had no issue.