首页 > 数据库 >sql文件备份

sql文件备份

时间:2024-07-23 22:30:47浏览次数:12  
标签:文件 SET utf8mb4 备份 COLLATE sql NULL id 0900

/*
Navicat Premium Data Transfer

Source Server : bookMeeting
Source Server Type : MySQL
Source Server Version : 80038
Source Host : localhost:3306
Source Schema : meetin_scheduling

Target Server Type : MySQL
Target Server Version : 80038
File Encoding : 65001

Date: 23/07/2024 22:25:10
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for reservation
-- ----------------------------
DROP TABLE IF EXISTS `reservation`;
CREATE TABLE `reservation` (
`id` bigint NOT NULL AUTO_INCREMENT,
`end_time` datetime(6) NULL DEFAULT NULL,
`start_time` datetime(6) NULL DEFAULT NULL,
`topic` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`room_id` bigint NULL DEFAULT NULL,
`user_id` bigint NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `FKm8xumi0g23038cw32oiva2ymw`(`room_id` ASC) USING BTREE,
INDEX `FKm4oimk0l1757o9pwavorj6ljg`(`user_id` ASC) USING BTREE,
CONSTRAINT `FKm4oimk0l1757o9pwavorj6ljg` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `FKm8xumi0g23038cw32oiva2ymw` FOREIGN KEY (`room_id`) REFERENCES `room` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for reservations
-- ----------------------------
DROP TABLE IF EXISTS `reservations`;
CREATE TABLE `reservations` (
`reservation_id` int NOT NULL AUTO_INCREMENT,
`room_id` int NULL DEFAULT NULL,
`user_id` int NULL DEFAULT NULL,
`start_time` datetime NOT NULL,
`end_time` datetime NOT NULL,
`topic` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
PRIMARY KEY (`reservation_id`) USING BTREE,
INDEX `room_id`(`room_id` ASC) USING BTREE,
INDEX `user_id`(`user_id` ASC) USING BTREE,
CONSTRAINT `reservations_ibfk_1` FOREIGN KEY (`room_id`) REFERENCES `rooms` (`room_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `reservations_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for room
-- ----------------------------
DROP TABLE IF EXISTS `room`;
CREATE TABLE `room` (
`id` bigint NOT NULL AUTO_INCREMENT,
`capacity` int NOT NULL,
`location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for rooms
-- ----------------------------
DROP TABLE IF EXISTS `rooms`;
CREATE TABLE `rooms` (
`room_id` int NOT NULL AUTO_INCREMENT,
`room_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`capacity` int NOT NULL,
PRIMARY KEY (`room_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` bigint NOT NULL AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`role` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `UK_sb8bbouer5wak8vyiiy4pf2bx`(`username` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for users
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`user_id` int NOT NULL AUTO_INCREMENT,
`username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`role` enum('admin','user') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT 'user',
PRIMARY KEY (`user_id`) USING BTREE,
UNIQUE INDEX `username`(`username` ASC) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;

标签:文件,SET,utf8mb4,备份,COLLATE,sql,NULL,id,0900
From: https://www.cnblogs.com/lz2z/p/18319780

相关文章

  • 9. 文件操作
    1.文件的两种打开方式方式一:打开后复制给句柄,句柄操作文件句柄  =  oopen(文件路径,操作模式,编码格式)其中操作模式有三种:r  只读模式  只能读不能写w  只写模式  只写不能读a  只追加模式  文件数据末尾添加内容 方式二:使用with关键字,自动打开......
  • SQL条件放在on、where、having的区别
    三种条件关键字的执行顺序如下:on>where>聚合函数>having1.表与表之间join的时候首先通过on条件关联,但是主表的记录不会被on条件过滤掉(如:leftjoin时左表为主表,数据将都保留)2.on条件关联好后,对于生成的数据,再用where条件过滤时,会存在将主表数据过滤掉的情况3.where条......
  • MySQL---------存储过程
    存储过程●介绍:存储过程是事先经过编译并存储在数据库中的一段SQL语句的集合,调用存储过程可以简化应用开发人员的很多工作,减少数据在数据库和应用服务器之间的传输,对于提高数据处理的效率是有好处的。存储过程思想上很简单,就是数据库SQL语言层面的代码封装与复用......
  • 使用Python自动备份MC服务器存档至轻量COS
    在存档意外炸档时,备份就显得尤为重要。本文以Minecraft1.18.2为例,教你如何使用轻量搭建一个MC服务器,并定时将存档备份入轻量COS,节省本地空间。前期准备一台安装了Linux原版系统的轻量(因为目前轻量COS仅支持挂载Linux系统镜像,不支持容器或自定义镜像)一个和轻量大区相同的轻......
  • 090、Python 写Excel文件及一些操作(使用xlwt库)
    要写Excel文件,我们需要使用第三方库。xlwt库是一个常用的写Excel的第三方库,它同时支持.xls和.xlsx。要使用第三方库,首选需安装:pipinstallxlwtxlutils安装完成后,我们就可以引入库来进行相关操作了。使用xrwt库写Excel文本,可以按以下步骤操作:1、第一步:创建工作簿(Wor......
  • 05_sparkSQL
    SparkSQL简介为什么需要SparkSQL?Spark的RDD有一定局限性,无法处理结构化数据(比如json格式等等);SparkSQL提供了两种编程的抽象,DataFrame(关心数据结构不关心类型),DataSet(关心面向对象的数据);RDD、DataFrame、DataSetDataFrameDataFrame是一种类似于RDD的分布式......
  • mybatisPlus3.4 自定义sqlSessionFactory sql注入器失效、mybatis-plus批量插入报错In
    文章目录一、报错背景二、解决方法在mybatis-plus项目中集成自定义批量插入方法后报错。以下整理一下报错及解决方法。一、报错背景mybatis-plus是不提供insertList批量插入方法的,本人在自定义批量插入方法后,启动时正常,但是执行到insertList时报错。org.apache.i......
  • [AHK2] 配置文件2
    开始先前,我们设计了一种简单的配置文件语法,可以方便的在记事本中编辑,然后进行读取;但是,功能停留在了读取上。事实上,我们还需要修改和写入功能,所以,今天我们来实现它。实现功能首先明确目标:实现修改功能实现写入功能要实现这两个目标,显然需要一个额外的变量来记录读取的文档......
  • k8s备份恢复之velero
    1.下载并安装velero客户端下载地址:https://github.com/vmware-tanzu/velero/releases#根据项目对应的k8s版本下载对应的版本,我的k8s版本为1.22所以下载1.11.0wgethttps://github.com/vmware-tanzu/velero/releases/download/v1.11.0/velero-v1.11.0-linux-amd64.tar.gztar......
  • 记录下Visual Studio 2022配置mysql
    visualstudio能够连接mysql只需要以下几步即可寻找mysql安装路径,如果你没有选择默认在C盘下ProgramFiles下mysql文件夹里,找到include和lib文件夹,分别复制路径。我们接下来来到visualstudio中,右键项目选择properties再将刚才复制的include跟lib的路径添加到Include......