当前位置: 首页 > news >正文

一次Navicat Premium 15(绿色) 命令页面的测试

Navicat Premium 15 :后台 SQL预览

CREATE TABLE NewTable (id int(11) NOT NULL AUTO_INCREMENT ,operation varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,operation_id int(11) NULL DEFAULT NULL ,operation_time datetime NULL DEFAULT NULL ,operation_params varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,PRIMARY KEY (id))ENGINE=InnoDBDEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ciAUTO_INCREMENT=2ROW_FORMAT=DYNAMIC;

CREATE TABLE ‘student_log’(’id‘ INT NOT NULL AUTO_INCREMENT, 这里有一个bug :INT没有11内存’operation‘ VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,’operation_id‘ INT(11),’operation_time‘ DATE, 2019-07-14 or '2019-07-14'’operation_params‘ VARCHAR(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL)ENGINE=INNODB 往下没有空格DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ciAUTO_INCREMENT=1ROW_FORMAT=DYNAMIC;

CHARACTER SET=utf8 这个是在建表的时候写的DEFAULT CHARACTER SET=utf8 这个好像是在后台配置的时候只有VARCHAR(200) 字符串才规定字符集和排序规则

CREATE TABLE ‘student_log’(’id‘ INT NOT NULL AUTO_INCREMENT, ’operation‘ VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,’operation_id‘ INT(11),’operation_time‘ DATE,’operation_params‘ VARCHAR(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL)ENGINE=INNODB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ciAUTO_INCREMENT=1ROW_FORMAT=DYNAMIC;

1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key

CREATE TABLE ‘student_log’(’id‘ INT NOT NULL AUTO_INCREMENT, ’operation‘ VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,’operation_id‘ INT(11),’operation_time‘ DATE,’operation_params‘ VARCHAR(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULLPRIMARY KEY(’id‘))ENGINE=INNODB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ciAUTO_INCREMENT=1ROW_FORMAT=DYNAMIC;

1067 - Invalid default value for '’operation_params‘' 不合法的值? 它说的这一句后面没有加','

CREATE TABLE student_log(

id INT NOT NULL AUTO_INCREMENT,

operation VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,operation_id INT(11),operation_time DATE,operation_params VARCHAR(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULLPRIMARY KEY(id))ENGINE=INNODB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ciAUTO_INCREMENT=1ROW_FORMAT=DYNAMIC;

1067 - Invalid default value for 'operation_params' 不合法的默认值?

CREATE TABLE student_log(

id INT NOT NULL AUTO_INCREMENT, 这里没有 INT(11) 也没报错

operation VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,operation_id INT(11),operation_time DATE,operation_params VARCHAR(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,PRIMARY KEY(id))ENGINE=INNODB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ciAUTO_INCREMENT=1ROW_FORMAT=DYNAMIC;

Query OK, 0 rows affected

注意:

别人写的name VARCHAR(20) PRIMARY KEY 字符列也可以成为主键。

相关文章:

  • 顺德网站建设公司价位/百度爱采购官网
  • 房地产网站建设的目的/大连seo按天付费
  • 创建网站的快捷方式/山东搜索引擎优化
  • 涡阳做网站/佛山网站快速排名提升
  • wordpress 禁止百度转码/引擎网站
  • 学做预算网站/在哪个平台做推广比较好
  • 模糊图像检测(c++)
  • 合宙ESP32S3 CameraWebServe 测试demo
  • 带模糊加工时间的柔性作业车间调度理论和GA复现(python)
  • 【Web前端学习笔记】第二章 CSS常见使用方法
  • 网络文件服务器:FileVista 8.9.3 Crack
  • Prometheus-Exporter详解
  • cmake的使用
  • 操作系统蓝屏无法启动修复后oracle无法使用问题
  • HummerRisk V0.9.0:增加RBAC 拓扑图,云检测、漏洞、主机等模块增加规则
  • springcloud--xxl-job
  • IDEA远程调试
  • Godot实现蝴蝶飞舞Shader