So far as I can tell this [default][1] container works fine: root $ root $ docker container list CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 7b119ef62a85 mysql/mysql-server:latest "/entrypoint.sh mysq…" 17 hours ago Up 17 hours (healthy) 0.0.0.0:3306->3306/tcp, 33060/tcp mysql root $ root $ mysql -h127.0.0.1:33060 -p -uroot Enter password: ERROR 2005 (HY000): Unknown MySQL server host '127.0.0.1:33060' (22) root $ root $ mysql -h127.0.0.1 -p -uroot Enter password: ERROR 1130 (HY000): Host '172.17.0.1' is not allowed to connect to this MySQL server root $ root $ docker exec -ti --user root mysql bash bash-4.2# bash-4.2# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2021 Server version: 8.0.21 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> mysql> exit Bye bash-4.2# bash-4.2# exit exit root $ How do I connect to the database directly from the host? Using: > Products Included in the Container > > A number of MySQL products are included in the Docker container you > created with the MySQL Server Docker image: > > MySQL Server and other MySQL Programs including the mysql client,mysqladmin, mysqldump, and so on. See the MySQL Reference > Manual for documentation of the products. although a simple console prompt acquired through `bash` from the host would be sufficient. Rather than [Connecting to MySQL Server from within the Container][2] or [Container Shell Access][3] I'm looking for access from the host. --------------------- from [the][4] container: mysql> mysql> select user,host from mysql.user; +------------------+-----------+ | user | host | +------------------+-----------+ | healthchecker | localhost | | mysql.infoschema | localhost | | mysql.session | localhost | | mysql.sys | localhost | | root | localhost | +------------------+-----------+ 5 rows in set (0.00 sec) mysql> [1]: https://hub.docker.com/r/mysql/mysql-server/ [2]: https://dev.mysql.com/doc/refman/8.0/en/docker-mysql-getting-started.html#docker-connecting-within-container [3]: https://dev.mysql.com/doc/refman/8.0/en/docker-mysql-getting-started.html#docker-shell-access [4]: https://devops.stackexchange.com/a/1657/23443