代码拉取完成,页面将自动刷新
create database tenant default character set utf8mb4;
use tenant;
CREATE TABLE `tenant`.`tenant` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
`db_name` varchar(255) DEFAULT '',
`alias` varchar(255) DEFAULT NULL COMMENT '唯一标识',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO tenant.tenant (id, name, db_name, alias) VALUES (1, '阳光', 'db_1', 'a');
INSERT INTO tenant.tenant (id, name, db_name, alias) VALUES (2, '锤子门', 'db_2', 'b');
INSERT INTO tenant.tenant (id, name, db_name, alias) VALUES (3, '海贼王', 'db_3', 'c');
create database db_1 default character set utf8mb4;;
CREATE TABLE if not exists `db_1`.`user` (
`id` bigint(22) NOT NULL AUTO_INCREMENT,
`username` varchar(255) DEFAULT NULL,
`password` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO db_1.user (id, username, password) VALUES (1, '阳光1', '123456');
INSERT INTO db_1.user (id, username, password) VALUES (2, '阳光2', '111111');
create database db_2 default character set utf8mb4;;
CREATE TABLE if not exists `db_2`.`user` (
`id` bigint(22) NOT NULL AUTO_INCREMENT,
`username` varchar(255) DEFAULT NULL,
`password` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO db_2.user (id, username, password) VALUES (1, '锤子1', '11111');
INSERT INTO db_2.user (id, username, password) VALUES (2, '锤子2', '22222');
create database db_3 default character set utf8mb4;;
CREATE TABLE if not exists `db_3`.`user` (
`id` bigint(22) NOT NULL AUTO_INCREMENT,
`username` varchar(255) DEFAULT NULL,
`password` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO db_3.user (id, username, password) VALUES (1, '路飞', '11111');
INSERT INTO db_3.user (id, username, password) VALUES (2, '索隆', '22222');
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。