corresponds to your MySQL server version for the right syntax to use near错误原因之一
来源:互联网 发布:linux zip 压缩 编辑:程序博客网 时间:2024/06/06 02:52
ID int(11) not null auto_increment,
DEPT_ID int(11) not null,
JOB_ID int(11) not null,
name varchar(20) not null,
CARD_ID varchar(18) not null,
ADDRESS varchar(50) not null,
POST_CODE varchar(50) default null,
TEL varchar(16) default null,
PHONE varchar(11) not null,
QQ_NUM varchar(11) default null,
EMAIL varchar(50) not null,
SEX int(11) not null default '1',
PARTY varchar(10) default null,
BIRTHDAY datetime default null,
RACE varchar(100) default null,
EDUCATION varchar(10) default null,
SPECIALITY varchar(20) default null,
HOBBY varchar(100) default null,
REMARK varchar(500) default null,
CREATE_DATE timestamp not null default current_timestamp,
primary key(id),
key FK_EMP_DEPT(DEPT_ID),
key FK_EMP_JOB(JOB_ID),
constraint FK_EMP_DEPT foreign key(DEPT_ID) references dept_inf (ID),
consistent FK_EMP_JOB foreign key(JOB_ID) references job_inf (ID)
)ENGINE=INNODB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8;
这样写会出错,要写成以下这样
CREATE TABLE `employee_inf` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`dept_id` INT(11) NOT NULL,
`job_id` INT(11) NOT NULL,
`name` VARCHAR(20) NOT NULL,
`card_id` VARCHAR(18) NOT NULL,
`address` VARCHAR(50) NOT NULL,
`post_code` VARCHAR(50) DEFAULT NULL,
`tel` VARCHAR(16) DEFAULT NULL,
`phone` VARCHAR(11) NOT NULL,
`qq_num` VARCHAR(10) DEFAULT NULL,
`emall` VARCHAR(50) NOT NULL,
`sex` INT(11) NOT NULL DEFAULT '1',
`party` VARCHAR(10) DEFAULT NULL,
`birthday` DATETIME DEFAULT NULL,
`race` VARCHAR(100) DEFAULT NULL,
`education` VARCHAR(10) DEFAULT NULL,
`speciality` VARCHAR(20) DEFAULT NULL,
`hobby` VARCHAR(100) DEFAULT NULL,
`remark` VARCHAR(500) DEFAULT NULL,
`create_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `fk_emp_dept` (`dept_id`),
KEY `fk_emp_job` (`job_id`),
CONSTRAINT `fk_emp_dept` FOREIGN KEY (`dept_id`) REFERENCES `dept_inf` (`id`),
CONSTRAINT `fk_emp_job` FOREIGN KEY (`job_id`) REFERENCES `job_inf` (`id`)
) ENGINE=INNODB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
原来以为问题出在关键字冲突,后来发现不是的,改成带有单引号的关键字后,发现通过了
所以是标准格式的原因
- corresponds to your MySQL server version for the right syntax to use near错误原因之一
- check the manual that corresponds to your MySQL server version for the right syntax to use near 'cre
- check the manual that corresponds to your MySQL server version for the right syntax to use near '..'
- check the manual that corresponds to your MySQL server version for the right syntax to use near 'oiw
- check the manual that corresponds to your MySQL server version for the right syntax to use near 'USI
- check the manual that corresponds to your MySQL server version for the right syntax to use near '?,?
- heck the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTI
- check the manual that corresponds to your MySQL server version for the right syntax to use near
- 异常“check the manual that corresponds to your MySQL server version for the right syntax to use near ”
- check the manual that corresponds to your MySQL server version for the right syntax to use near‘XXX’
- CHECK the manual that corresponds TO your MySQL SERVER VERSION FOR the RIGHT syntax TO USE near.....
- corresponds to your MySQL server version for the right syntax to use near 'describe)values(225,0,'aa
- check the manual that corresponds to your MySQL server version for the right syntax to use
- MySQL check the manual that corresponds to your MySQL server version for the right syntax错误
- MySQL check the manual that corresponds to your MySQL server version for the right syntax错误
- MySQL check the manual that corresponds to your MySQL server version for the right syntax错误
- MySQL check the manual that corresponds to your MySQL server version for the right syntax错误
- MySQL check the manual that corresponds to your MySQL server version for the right syntax错误
- Java练习(方法调用)
- 快速幂求模+矩阵的快速幂
- 过山车
- ConnectionResetError: [Errno 104] Connection reset by peer
- HDU-2017中国大学生程序设计竞赛-网络选拔赛-1005-CaoHaha's staff
- corresponds to your MySQL server version for the right syntax to use near错误原因之一
- BZOJ 1086 [SCOI 2005] 王室联邦
- Java 中的锁 -Lock 接口解析
- java 控制台输入(标准输入法)以及Scanner的用法、以及Console的用法
- OSS之访问控制
- HDOJ1232 并查集入门题
- jvm源码阅读笔记[1]:如何触发一次CMS回收
- 贪心算法--Dijkstra算法(单源最短路径算法)
- C