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

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
主站蜘蛛池模板: 邵阳县| 页游| 太谷县| 柏乡县| 富平县| 南宁市| 邳州市| 富源县| 柳江县| 普宁市| 阳江市| 株洲市| 泗水县| 诸城市| 冕宁县| 寻甸| 凤凰县| 会东县| 东辽县| 拜泉县| 广河县| 松江区| 榕江县| 大城县| 宣恩县| 美姑县| 皮山县| 亚东县| 交口县| 紫云| 绍兴县| 法库县| 塔河县| 平陆县| 措美县| 金溪县| 涞源县| 富源县| 商河县| 罗甸县| 定兴县|