nacos链接mysql建表语句
时间: 2023-09-13 08:09:36 浏览: 85
nacos-config 建表sql
在Nacos连接MySQL并建表的过程中,可以使用以下建表语句:
```sql
CREATE DATABASE IF NOT EXISTS nacos DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci;
USE nacos;
CREATE TABLE IF NOT EXISTS `config_info` (
`id` varchar(128) NOT NULL,
`data_id` varchar(256) NOT NULL,
`group_id` varchar(128) NOT NULL,
`content` longtext NOT NULL,
`md5` varchar(32) DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `uk_configinfo_dataid_groupid` (`data_id`,`group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
CREATE TABLE IF NOT EXISTS `namespace` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`namespace_id` varchar(64) NOT NULL,
`namespace_name` varchar(128) NOT NULL,
`quota` int(11) DEFAULT NULL,
`config_count` int(11) DEFAULT NULL,
`type` int(11) DEFAULT NULL,
`gmt_create` datetime DEFAULT NULL,
`gmt_modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `uk_namespace_id` (`namespace_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
```
以上是nacos数据库的建表语句,用于创建`config_info`和`namespace`两个表。其中,`config_info`表包含了配置信息的相关数据,而`namespace`表用于存储命名空间的信息。这些表的创建语句可以在连接MySQL的Nacos系统中执行,以完成建表操作。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [Mysql表结构转Postgresql建表语句快速操作](https://blog.csdn.net/qq_42105629/article/details/123526928)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [NACOS以MySQL为数据源的SQL导入文件](https://download.csdn.net/download/AlexanderRon/84270909)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [Linux下Docker安装Nacos并配置mysql详细](https://blog.csdn.net/create_bj/article/details/124847865)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文