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

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
主站蜘蛛池模板: 闽清县| 绥江县| 东宁县| 栾川县| 松溪县| 盘山县| 洛扎县| 苍南县| 万盛区| 宁海县| 乡宁县| 枣阳市| 绥棱县| 綦江县| 抚顺县| 乌海市| 咸阳市| 常德市| 九龙城区| 福安市| 綦江县| 上思县| 东乡| 松原市| 漠河县| 井陉县| 清河县| 柳江县| 寻甸| 南皮县| 五大连池市| 廉江市| 昌都县| 定结县| 柳江县| 沂南县| 新乡县| 抚州市| 徐州市| 梁河县| 繁昌县|