我使用以下命令启动Docker MySQL:
docker run -p 3306:3306 --name mysql5.7 -e MYSQL_ROOT_PASSWORD=b3RmELKOvCUrAdxIg0GEmugc3SY -d mysql:5.7
但是我无法从主机连接到它:
$ /Applications/MySQLWorkbench.app/Contents/MacOS/mysql -h localhost -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)