关于用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. berkeley db replica机制 - 主从同步

    repmgr/repmgr_net.c, __repmgr_send(): 做send_broadcast, 然后根据policy 对DB_REP_PERMANENT的处理 __repmgr_send ...

  2. 以太网客户端提示windows系统自带共享代理解决方法

    以太网客户端(Dr.COM)登陆出现windows系统自带共享代理,如下图: 系统win+R调出运行: 在服务中,找到Internet Connection Sharing (ICS): 右键属性,将 ...

  3. 备份数据库的时候设置 BufferCount 选项不正确导致 out of memory 的情况

    备份数据库的时候设置 BufferCount 选项不正确导致 out of memory 的情况 今天群里面的东辉兄跟我说备份生产数据库的时候报错 环境: 32位的SQLSERVER2008 机器有1 ...

  4. 【原创】Windows Server 文件夹权限小问题

    服务器:Windows Server 2008 R2 Standard 做文件服务器 问题:在资源管理器里给账号设置了R/W权限,但是一直有问题,写失败. 解决:需要在server manager-r ...

  5. 我总结的Android编程规范

    命名规则 1). 类名,接口名:以大写开头,如果一个类的类名由多个单词组成,所有单词的首字母必须大写,单词尽量写全称,不要简写,除非约定俗成的名字,例如:URL,RTMP,RTSP 这些广泛使用的专有 ...

  6. Google被墙 Android开发工具下载地址

    Android开发环境的官网下载地址 可以直接下载 (1)Adt Bundle Platform Package Size MD5 Checksum Windows 32-bit adt-bundle ...

  7. 【转】CentOS中vsftp安装、配置、卸载

    1. 安装VSFTP yum -y install vsftpd 2. 配置vsftpd.conf文件 # Example config file /etc/vsftpd/vsftpd.conf # ...

  8. ASP.NET Core 源码阅读笔记(3) ---Microsoft.AspNetCore.Hosting

    有关Hosting的基础知识 Hosting是一个非常重要,但又很难翻译成中文的概念.翻译成:寄宿,大概能勉强地传达它的意思.我们知道,有一些病毒离开了活体之后就会死亡,我们把那些活体称为病毒的宿主. ...

  9. Mac上远程桌面连接Windows Server 2012 R2

    在将一台服务器的操作系统由Windows Server 2012升级为Windows Server 2012 R2之后,在Mac电脑上用微软的远程桌面软件怎么也连不上服务器,错误信息如下: Remot ...

  10. 转载:APP的上线和推广——线上推广渠道

    本文版权归个人所有,如需转载请注明出处http://www.cnblogs.com/PengLee/p/4637080.html 目录 应用商店 互联网开放平台 软件下载中心 媒体社交平台 刷榜推广 ...