官术网_书友最值得收藏!

Setting up MySQL as a container service

In this section, you will learn how to set up MySQL as a container service. In the Docker terminal, execute the following command:

docker run -ti -d -p 3326:3306 --name mysqldev -e MYSQL_ROOT_PASSWORD=r00t -v "$PWD":/mnt/ mysql:5.7

The preceding command sets up MySQL 5.7 version within the container, and starts the mysqld service. Open MySQL Workbench, and create a new connection by entering the details such as those shown in the following screenshot; click on Test Connection. You should be able to establish the connection successfully:

Figure 1.21: MySQL server running in the container and accessible from host machine at 3326 port using MySQL Workbench
主站蜘蛛池模板: 拉萨市| 舟山市| 增城市| 东乡县| 巫溪县| 荣昌县| 吉水县| 岱山县| 习水县| 德庆县| 信丰县| 河北区| 田林县| 崇礼县| 钦州市| 临城县| 湛江市| 鄂尔多斯市| 泰宁县| 津南区| 东台市| 贞丰县| 井陉县| 调兵山市| 胶州市| 广宁县| 洞口县| 长丰县| 西充县| 清徐县| 仙桃市| 伊金霍洛旗| 松江区| 铜梁县| 竹山县| 大庆市| 呼和浩特市| 元朗区| 青河县| 阳泉市| 广汉市|