关于用Power Designer 生成sql文件出现 错误  [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int not null auto_increment comment '用户id',

的解决办法

sql语句如下

 drop table if exists tb_users;

 /*==============================================================*/
/* Table: tb_users */
/*==============================================================*/
create table tb_users
(
userid national int not null auto_increment comment '用户id',
orgid int comment '组织id',
username varchar() not null comment '姓名',
account varchar() comment '账号',
password varchar() comment '密码',
sex varchar() comment '性别',
phone varchar() comment '电话',
duties varchar() comment '岗位职务',
mail varchar() comment '邮箱',
personstatus char default '' comment '人员状态(0在职,1离职)',
accountstatus char default '' comment '账号状态(0正常,1注销)',
enabletime datetime comment '账号登录有效时间',
newaddtime datetime comment '新增时间',
updatetime datetime comment '更新时间',
operater varchar() comment '操作人',
lastloadtime datetime comment '最后登录时间',
bz1 varchar() comment '备注1',
bz2 varchar() comment '备注2',
bz3 varchar() comment '备注3',
primary key (userid)
); alter table tb_users comment '用户表'; alter table tb_users add constraint FK_Reference_11 foreign key (orgid)
references tb_organize (orgid) on delete restrict on update restrict;

执行后出现如下错误,

[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int not null auto_increment comment '用户id',
orgid int com' at line 6

  解决办法:

是否发现执行的sql语句中多了个national关键字,把这个关键字去掉就可以。

在podwer designer 中设置如图:把前面对号去掉就可以

MySql 执行语句错误 Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near的更多相关文章

  1. SQL语句报错:You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near

    报错如图: 最开始其实我的列名tname和tsubject分别叫name和subject,后来看到网上有说这个报错可能是数据库建表的时候使用了mysql的关键词,我就只把name改了.后来还是这个问题 ...

  2. [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''<h1 style="text-align: center;">php

    [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL s ...

  3. sql语句 异常 Err] 1064 - You have an error in your SQL syntax;

    在我们开发的工程中,有时候会报[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds ...

  4. 插入mysql语句报错:1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near

    插入一个很简单的sql语句时候,mysql一直报错: [SQL] INSERT INTO ORDER ( id, activity_id, order_type, phone, order_amoun ...

  5. 插入数据库失败([Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version)

    报错信息如下: , ) 原因,read是数据库的关键字, 牢记,如果一个词是数据库的关键字,那么在写数据库语句的时候,这个词一定是蓝色的(关键字颜色)!!

  6. 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups)VALUES('1','hh','hh@163.com','Boss')' at line 1

    mysql8.0版本 在已存在的表里插入一条数据 insert INTO api_user(id,username,email,groups)VALUES('1','hh','hh@163.com', ...

  7. 解决ROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'creat table study_record( id int(11) not null

    之前一直用的好好的,突然就出现了这个错误: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual tha ...

  8. SQL Error: 1064, SQLState: 42000 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version

    -- ::, WARN [org.hibernate.util.JDBCExceptionReporter:] - SQL Error: , SQLState: -- ::, ERROR [org.h ...

  9. C# Mysql You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ????

    有几年没用过MySql数据了,今天在使用C#访问MySql数据库时出现了一个小插曲. 错误提示: You have an error in your SQL syntax; check the man ...

随机推荐

  1. HTTP 头部

      通用头域(即通用头) 通用头域包含请求和响应消息都支持的头域,通用头域包含Cache-Control. Connection.Date.Pragma.Transfer-Encoding.Upgra ...

  2. Git命令行初体验

    1. git 版本控制系统 ==============运行环境======== 系统:windows git : Git-1.7.3.1-preview20101002.rar  下载地址:http ...

  3. C#开发中使用Npoi操作excel实例代码

    C#开发中使用Npoi操作excel实例代码 出处:西西整理 作者:西西 日期:2012/11/16 9:35:50 [大 中 小] 评论: 0 | 我要发表看法 Npoi 是什么? 1.整个Exce ...

  4. Linux ubuntu 10.10安装OpenCv

    在windows系统下已经成功做出了一个打开摄像头并检测人脸的小程序了. 开始转战linux,因为最终目标是将程序移植到嵌入式开发板上面. 但是,问题接踵而至~ 首先linux上面要安装OpenCv, ...

  5. java获取classpath文件路径空格转变成了转义字符%20的问题

    java获取classpath文件路径空格转变成了转义字符%20的问题 这个问题很纠结,服务器的文件路径带有空格,空格被转化是%20了,悲剧就出现了 下面展示一段代码String path = get ...

  6. EmberJs之Ember-Data

    写在前面 最近比较忙,换了新工作还要学习很多全新的技术栈,并给自己找了很多借口来不去坚持写博客.常常具有讽刺意味的是,更多剩下的时间并没有利用而更多的是白白浪费,也许这就是青春吧,挥霍吧,这不是我想要 ...

  7. BugTracker 功能说明(有图有真相)

    一.简单介绍 BugTracker是基于Asp.Net,C#, SqlServer的一个web端Bug管理系统.发布在IIS上.能够对不同项目,不同组织,不同人员的bug进行管理和更新设计优先级和用户 ...

  8. https封装类,支持get/post请求

    所需jar:commons-logging-1.1.3.jar.httpclient-4.3.1.jar.httpcore-4.3.jar package com.onlyou.microfinanc ...

  9. SQL——系统函数

    1) CASE CASE有两种使用形式:一种是简单的CASE函数,另一种是搜索型的CASE函数. [1]简单的 CASE 函数 Format: CASE input_expression WHEN w ...

  10. 相对路径获取项目文件 及报错 No mapping found for HTTP request with URI XXX in DispatcherServlet with name ‘springmvc’解决方法

    首先一点,WebRoot目录下的文件是都可以通过浏览器输入路径,直接读取到的 例如这样: 而WebRoot下面WEB-INF是无法浏览器输入路径直接读取的. 因为是受保护的. 如果jsp读取一个图片的 ...