user3755094
user3755094

Reputation: 1

MySQL error 6400 (42000) check the manual corresponds to your Mysql server version

this is my table:

mysql> create table medication(
        mid int (11) not null auto_increment  primary key, 
        tid varchar(255) not null,
        titname varchar(255) not null,
        minvalue varchar(255) not null, 
        maxvalue varchar(255) not null,
        disc varchar(255) not null, 
        tanem varchar(255) default null);

here is the error

Error 1064 (42000): you have an error in you SQL syntax; check the manual that corresponds to you MySQL server version for the right syntax to use near 'maxvalue varchar(255) not null, disc varchar(255) not null, tname varchar(255) d ' at line 1

My sql version is : 5.6.19 - win 32 os: windows 7, 64bit

Other table are saved successfully with almost same pattern. but for this table only showing error.

Help me, thank you.

Upvotes: 0

Views: 426

Answers (2)

Nagaraj S
Nagaraj S

Reputation: 13484

maxvalue is a reserved keyword in mysql

mysql> create table medication(
        mid int not null auto_increment  primary key, 
        tid varchar(255) not null,
        titname varchar(255) not null,
        minvalue varchar(255) not null, 
        `maxvalue` varchar(255) not null,
        disc varchar(255) not null, 
        tanem varchar(255) default null);

Working Fiddle

Upvotes: 1

Sadikhasan
Sadikhasan

Reputation: 18600

maxvalue is reserve key word in mysql. Check Manual for Reserve word.

create table `medication`(
`mid` int (11) not null auto_increment  primary key, 
`tid` varchar(255) not null,
`titname` varchar(255) not null,
`minvalue` varchar(255) not null, 
`maxvalue` varchar(255) not null,
`disc` varchar(255) not null, 
`tanem` varchar(255) default null);

Upvotes: 0

Related Questions