sql 创建表

步骤一:创建数据库并指定字符集

CREATE DATABASE database_name DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

步骤二:选择要操作的数据库

USE database_name;

步骤三:创建表格

-- auto-generated definition
create table i5_xxxxxxxxxxx
(
id int auto_increment
primary key,
mapping_id int default 0 not null comment '关联ID',
json_content longtext null,
is_sync int default 0 not null,
last_update_time int default 0 not null,
constraint i5_xxxxxxxxxx_id_uindex
unique (mapping_id)
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci;

步骤四:查看表有没有成功

show tables;

修改表名称

rename table i5_xxxxx to i5_xxxxx_11;
rename table i5_xxxxx_mapping_json to i5_xxxxx_mapping_json_11;
posted @   Lafite-1820  阅读(16)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
点击右上角即可分享
微信分享提示