Docker mysql+nacos单机部署的实现步骤
作者:zyppxx
docker 网络创建
由于nacos需要访问mysql的数据,因此mysql容器和nacos容器之间需要进行通信。容器间通信有很多方式,在这里采用同一网络下的方式进行实现。因此需要创建网络。创建网络的命令如下:
docker network create --driver bridge nacos-mysql
通过上述命令就创建了一个bridge类型的网络,该网络的名称为nacos-mysql。创建网络完成后可以通过下面命令查看:
docker network ls
mysql容器创建
创建MySQL容器的过程中需要注意两点:
- 将MySQL容器接入到刚才创建的网络中
- 将配置文件容器卷进行挂载
MySQL容器的创建如下:
docker run --net=nacos-mysql --restart=always -p 3306:3306 --name=mysql -v D:\docker\MySQL\conf:/etc/mysql/conf.d -v D:\docker\MySQL\log:/var/log/mysql -v D:\docker\MySQL\data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=password -d mysql:latest
需要注意的是net命令和restart命令都需要紧跟run后,否则容器将启动失败。上述代码执行后将启动了一个mysql容器 ,用户名为root,密码为password,接入了nacos-mysql网络环境下,每次docker重启都将自动运行,映射了端口3306,并且如果D:\docker\MySQL\conf下存在配置文件则应该使用该配置文件。但是实际该容器并不会使用挂载出来的配置问题,这是由于mysql容器读取配置文件时要求该配置文件的权限并不应该为777,777的权限过高,mysql认为该权限不具备安全性,因此将采用默认配置文件进行运行系统。这就需要我们进入容器内容进行修改该文件的权限。进入容器的命令如下:
docker exec -it mysql /bin/bash
进入指定目录:
cd /etc/mysql/conf.d
设置文件权限(其上级目录必须时777的权限):
chmod 664 my.cnf
然后重启容器,此时,容器重启时将读取我们指定的配置文件,如果设置了启动服务是使用到的参数,则需要将mysql上次服务启动时创建的data数据全部删除。
nacos部署
mysql部署和mysql类似,主要需要考虑的就是将容器接入nacos-mysql网络中,并且将数据库连接设置为mysql,同一自定义网络下的容器可以直接通过容器名进行网络通信。nacos的启动命令如下:
docker run -itd --net=nacos-mysql --restart=always -p 8848:8848 -p 9848:9848 -p 9849:9849 --name=nacos -e MODE=standalone -e SPRING_DATASOURCE_PLATFORM=mysql -e MYSQL_SERVICE_HOST=mysql -e MYSQL_SERVICE_PORT=3306 -e MYSQL_SERVICE_DB_NAME=nacos_config -e MYSQL_SERVICE_USER=root -e MYSQL_SERVICE_PASSWORD=password -e MYSQL_DATABASE_NUM=1 nacos/nacos-server
命令中:MYSQL_SERVICE_HOST=mysql即指明了mysql服务的地址时mysql。上述过程完成了mysql和nacos的docker部署,在部署完成之后,我们可以查看网络状态,验证两个容器是否接入到了指定自定义网络中,命令:
docker inspect network nacos-mysql
至此,我们发现两个容器都在同一个网络中了。nacos的mysql数据库表结构如下所示:
/* Navicat Premium Data Transfer Source Server : localhost Source Server Type : MySQL Source Server Version : 80031 Source Host : localhost:3306 Source Schema : nacos_config Target Server Type : MySQL Target Server Version : 80031 File Encoding : 65001 Date: 08/08/2023 23:10:27 */ SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for config_info -- ---------------------------- DROP TABLE IF EXISTS `config_info`; CREATE TABLE `config_info` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id', `data_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'data_id', `group_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT NULL, `content` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'content', `md5` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT NULL COMMENT 'md5', `gmt_create` datetime NOT NULL DEFAULT '2010-05-05 00:00:00' COMMENT '鍒涘缓鏃堕棿', `gmt_modified` datetime NOT NULL DEFAULT '2010-05-05 00:00:00' COMMENT '淇?敼鏃堕棿', `src_user` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL COMMENT 'source user', `src_ip` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT NULL COMMENT 'source ip', `app_name` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT NULL, `tenant_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT '' COMMENT '绉熸埛瀛楁?', `c_desc` varchar(256) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT NULL, `c_use` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT NULL, `effect` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT NULL, `type` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT NULL, `c_schema` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL, `encrypted_data_key` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT '绉橀挜', PRIMARY KEY (`id`) USING BTREE, UNIQUE INDEX `uk_configinfo_datagrouptenant`(`data_id` ASC, `group_id` ASC, `tenant_id` ASC) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 206 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_bin COMMENT = 'config_info' ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Table structure for config_info_aggr -- ---------------------------- DROP TABLE IF EXISTS `config_info_aggr`; CREATE TABLE `config_info_aggr` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id', `data_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'data_id', `group_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'group_id', `datum_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'datum_id', `content` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT '鍐呭?', `gmt_modified` datetime NOT NULL COMMENT '淇?敼鏃堕棿', `app_name` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT NULL, `tenant_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT '' COMMENT '绉熸埛瀛楁?', PRIMARY KEY (`id`) USING BTREE, UNIQUE INDEX `uk_configinfoaggr_datagrouptenantdatum`(`data_id` ASC, `group_id` ASC, `tenant_id` ASC, `datum_id` ASC) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_bin COMMENT = '澧炲姞绉熸埛瀛楁?' ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of config_info_aggr -- ---------------------------- -- ---------------------------- -- Table structure for config_info_beta -- ---------------------------- DROP TABLE IF EXISTS `config_info_beta`; CREATE TABLE `config_info_beta` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id', `data_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'data_id', `group_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'group_id', `app_name` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT NULL COMMENT 'app_name', `content` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'content', `beta_ips` varchar(1024) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT NULL COMMENT 'betaIps', `md5` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT NULL COMMENT 'md5', `gmt_create` datetime NOT NULL DEFAULT '2010-05-05 00:00:00' COMMENT '鍒涘缓鏃堕棿', `gmt_modified` datetime NOT NULL DEFAULT '2010-05-05 00:00:00' COMMENT '淇?敼鏃堕棿', `src_user` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL COMMENT 'source user', `src_ip` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT NULL COMMENT 'source ip', `tenant_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT '' COMMENT '绉熸埛瀛楁?', `encrypted_data_key` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT '绉橀挜', PRIMARY KEY (`id`) USING BTREE, UNIQUE INDEX `uk_configinfobeta_datagrouptenant`(`data_id` ASC, `group_id` ASC, `tenant_id` ASC) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_bin COMMENT = 'config_info_beta' ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of config_info_beta -- ---------------------------- -- ---------------------------- -- Table structure for config_info_tag -- ---------------------------- DROP TABLE IF EXISTS `config_info_tag`; CREATE TABLE `config_info_tag` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id', `data_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'data_id', `group_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'group_id', `tenant_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT '' COMMENT 'tenant_id', `tag_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'tag_id', `app_name` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT NULL COMMENT 'app_name', `content` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'content', `md5` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT NULL COMMENT 'md5', `gmt_create` datetime NOT NULL DEFAULT '2010-05-05 00:00:00' COMMENT '鍒涘缓鏃堕棿', `gmt_modified` datetime NOT NULL DEFAULT '2010-05-05 00:00:00' COMMENT '淇?敼鏃堕棿', `src_user` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL COMMENT 'source user', `src_ip` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT NULL COMMENT 'source ip', PRIMARY KEY (`id`) USING BTREE, UNIQUE INDEX `uk_configinfotag_datagrouptenanttag`(`data_id` ASC, `group_id` ASC, `tenant_id` ASC, `tag_id` ASC) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_bin COMMENT = 'config_info_tag' ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of config_info_tag -- ---------------------------- -- ---------------------------- -- Table structure for config_tags_relation -- ---------------------------- DROP TABLE IF EXISTS `config_tags_relation`; CREATE TABLE `config_tags_relation` ( `id` bigint NOT NULL COMMENT 'id', `tag_name` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'tag_name', `tag_type` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT NULL COMMENT 'tag_type', `data_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'data_id', `group_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'group_id', `tenant_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT '' COMMENT 'tenant_id', `nid` bigint NOT NULL AUTO_INCREMENT, PRIMARY KEY (`nid`) USING BTREE, UNIQUE INDEX `uk_configtagrelation_configidtag`(`id` ASC, `tag_name` ASC, `tag_type` ASC) USING BTREE, INDEX `idx_tenant_id`(`tenant_id` ASC) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_bin COMMENT = 'config_tag_relation' ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of config_tags_relation -- ---------------------------- -- ---------------------------- -- Table structure for group_capacity -- ---------------------------- DROP TABLE IF EXISTS `group_capacity`; CREATE TABLE `group_capacity` ( `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '涓婚敭ID', `group_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '' COMMENT 'Group ID锛岀┖瀛楃?琛ㄧず鏁翠釜闆嗙兢', `quota` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '閰嶉?锛?琛ㄧず浣跨敤榛樿?鍊', `usage` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '浣跨敤閲', `max_size` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '鍗曚釜閰嶇疆澶у皬涓婇檺锛屽崟浣嶄负瀛楄妭锛?琛ㄧず浣跨敤榛樿?鍊', `max_aggr_count` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '鑱氬悎瀛愰厤缃?渶澶т釜鏁帮紝锛?琛ㄧず浣跨敤榛樿?鍊', `max_aggr_size` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '鍗曚釜鑱氬悎鏁版嵁鐨勫瓙閰嶇疆澶у皬涓婇檺锛屽崟浣嶄负瀛楄妭锛?琛ㄧず浣跨敤榛樿?鍊', `max_history_count` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '鏈?ぇ鍙樻洿鍘嗗彶鏁伴噺', `gmt_create` datetime NOT NULL DEFAULT '2010-05-05 00:00:00' COMMENT '鍒涘缓鏃堕棿', `gmt_modified` datetime NOT NULL DEFAULT '2010-05-05 00:00:00' COMMENT '淇?敼鏃堕棿', PRIMARY KEY (`id`) USING BTREE, UNIQUE INDEX `uk_group_id`(`group_id` ASC) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_bin COMMENT = '闆嗙兢銆佸悇Group瀹归噺淇℃伅琛' ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of group_capacity -- ---------------------------- -- ---------------------------- -- Table structure for his_config_info -- ---------------------------- DROP TABLE IF EXISTS `his_config_info`; CREATE TABLE `his_config_info` ( `id` bigint UNSIGNED NOT NULL, `nid` bigint UNSIGNED NOT NULL AUTO_INCREMENT, `data_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL, `group_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL, `app_name` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT NULL COMMENT 'app_name', `content` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL, `md5` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT NULL, `gmt_create` datetime NOT NULL DEFAULT '2010-05-05 00:00:00', `gmt_modified` datetime NOT NULL DEFAULT '2010-05-05 00:00:00', `src_user` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL, `src_ip` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT NULL, `op_type` char(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT NULL, `tenant_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT '' COMMENT '绉熸埛瀛楁?', `encrypted_data_key` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT '绉橀挜', PRIMARY KEY (`nid`) USING BTREE, INDEX `idx_gmt_create`(`gmt_create` ASC) USING BTREE, INDEX `idx_gmt_modified`(`gmt_modified` ASC) USING BTREE, INDEX `idx_did`(`data_id` ASC) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 231 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_bin COMMENT = '澶氱?鎴锋敼閫' ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Table structure for permissions -- ---------------------------- DROP TABLE IF EXISTS `permissions`; CREATE TABLE `permissions` ( `role` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, `resource` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, `action` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, UNIQUE INDEX `uk_role_permission`(`role` ASC, `resource` ASC, `action` ASC) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of permissions -- ---------------------------- -- ---------------------------- -- Table structure for roles -- ---------------------------- DROP TABLE IF EXISTS `roles`; CREATE TABLE `roles` ( `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, `role` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, UNIQUE INDEX `uk_username_role`(`username` ASC, `role` ASC) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of roles -- ---------------------------- INSERT INTO `roles` VALUES ('nacos', 'ROLE_ADMIN'); -- ---------------------------- -- Table structure for tenant_capacity -- ---------------------------- DROP TABLE IF EXISTS `tenant_capacity`; CREATE TABLE `tenant_capacity` ( `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '涓婚敭ID', `tenant_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL DEFAULT '' COMMENT 'Tenant ID', `quota` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '閰嶉?锛?琛ㄧず浣跨敤榛樿?鍊', `usage` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '浣跨敤閲', `max_size` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '鍗曚釜閰嶇疆澶у皬涓婇檺锛屽崟浣嶄负瀛楄妭锛?琛ㄧず浣跨敤榛樿?鍊', `max_aggr_count` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '鑱氬悎瀛愰厤缃?渶澶т釜鏁', `max_aggr_size` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '鍗曚釜鑱氬悎鏁版嵁鐨勫瓙閰嶇疆澶у皬涓婇檺锛屽崟浣嶄负瀛楄妭锛?琛ㄧず浣跨敤榛樿?鍊', `max_history_count` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '鏈?ぇ鍙樻洿鍘嗗彶鏁伴噺', `gmt_create` datetime NOT NULL DEFAULT '2010-05-05 00:00:00' COMMENT '鍒涘缓鏃堕棿', `gmt_modified` datetime NOT NULL DEFAULT '2010-05-05 00:00:00' COMMENT '淇?敼鏃堕棿', PRIMARY KEY (`id`) USING BTREE, UNIQUE INDEX `uk_tenant_id`(`tenant_id` ASC) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_bin COMMENT = '绉熸埛瀹归噺淇℃伅琛' ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of tenant_capacity -- ---------------------------- -- ---------------------------- -- Table structure for tenant_info -- ---------------------------- DROP TABLE IF EXISTS `tenant_info`; CREATE TABLE `tenant_info` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id', `kp` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL COMMENT 'kp', `tenant_id` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT '' COMMENT 'tenant_id', `tenant_name` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT '' COMMENT 'tenant_name', `tenant_desc` varchar(256) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT NULL COMMENT 'tenant_desc', `create_source` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT NULL COMMENT 'create_source', `gmt_create` bigint NOT NULL COMMENT '鍒涘缓鏃堕棿', `gmt_modified` bigint NOT NULL COMMENT '淇?敼鏃堕棿', PRIMARY KEY (`id`) USING BTREE, UNIQUE INDEX `uk_tenant_info_kptenantid`(`kp` ASC, `tenant_id` ASC) USING BTREE, INDEX `idx_tenant_id`(`tenant_id` ASC) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_bin COMMENT = 'tenant_info' ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Table structure for users -- ---------------------------- DROP TABLE IF EXISTS `users`; CREATE TABLE `users` ( `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, `password` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, `enabled` tinyint(1) NOT NULL, PRIMARY KEY (`username`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of users -- ---------------------------- INSERT INTO `users` VALUES ('nacos', '$2a$10$EuWPZHzz32dJN7jexM34MOeYirDdFAZm2kuWj7VEOJhhZkDrxfvUu', 1); SET FOREIGN_KEY_CHECKS = 1;
请忽略中文乱码问题(_),用户名和密码都为nacos。
到此这篇关于Docker mysql+nacos单机部署的实现步骤的文章就介绍到这了,更多相关Docker mysql+nacos单机部署内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!