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

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
主站蜘蛛池模板: 慈溪市| 拉萨市| 平武县| 沭阳县| 凉城县| 奈曼旗| 绥德县| 中西区| 梓潼县| 台州市| 古交市| 琼海市| 嘉峪关市| 河南省| 海晏县| 东乌珠穆沁旗| 高邑县| 噶尔县| 新乐市| 全南县| 成都市| 陈巴尔虎旗| 宾阳县| 库尔勒市| 泰顺县| 周宁县| 成武县| 望谟县| 永川市| 永兴县| 东方市| 皮山县| 湘西| 白水县| 乌什县| 方山县| 富锦市| 南召县| 株洲市| 岳池县| 天全县|