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

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
主站蜘蛛池模板: 育儿| 宁强县| 皮山县| 绥江县| 葵青区| 哈尔滨市| 新龙县| 酒泉市| 开鲁县| 瑞金市| 富顺县| 潮安县| 贡嘎县| 呼玛县| 信丰县| 汤原县| 霍林郭勒市| 富宁县| 贵州省| 荥经县| 鹤壁市| 正阳县| 常州市| 永川市| 揭西县| 法库县| 六枝特区| 象州县| 顺昌县| 曲周县| 兴义市| 新巴尔虎右旗| 宜川县| 胶南市| 邛崃市| 迭部县| 承德县| 即墨市| 报价| 衡东县| 成都市|