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

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
主站蜘蛛池模板: 青海省| 石嘴山市| 庐江县| 锦屏县| 东海县| 陵川县| 灵武市| 松潘县| 保康县| 蕲春县| 大埔县| 彰化县| 台北市| 山东省| 米易县| 偃师市| 铁力市| 昆山市| 扎鲁特旗| 洪洞县| 方正县| 秦皇岛市| 大冶市| 南昌市| 天津市| 平南县| SHOW| 阿尔山市| 吉水县| 城口县| 皋兰县| 孟村| 河西区| 廉江市| 土默特右旗| 璧山县| 晋宁县| 息烽县| 瑞安市| 双辽市| 岑巩县|