Dynadot โ€” .com Registration $8.99

Need help: #1067 - Invalid default value for 'ID'

Spaceship Spaceship
Watch

aing

Established Member
Impact
4
I have mysql syntax as seen below, and there is problem on it. I'm using mysql 4.1.21-standard version


CREATE TABLE alumni (
ID int(11) DEFAULT '0' NOT NULL auto_increment,
First_Name varchar(56) NOT NULL,
Last_Name varchar(128) NOT NULL,
bla...bla...bla...
bla...bla...bla...
bla...bla...bla...
PRIMARY KEY (ID),
KEY ID (ID)
);

and it appears error #1067 - Invalid default value for 'ID'

what should i do? should i change the default value with DEFAULT ''?
but i think the '' value just for text not for integer

anyone could solve this error?
many thanks

aing
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
There is no need to specify a default for a ID column. Since it's autonumber the system will always generate a value automatically.
 
1
•••
so, do i have to delete the DEFAULT '0'?
will it affect to result?
i did it and it goes OK, but the script get error maybe it because of my setting
Thanks anyway
 
0
•••
If you remove DEFAULT '0' you should be OK.
If you still have errors please post the error message.
 
0
•••
Dynadot โ€” .com Registration $8.99Dynadot โ€” .com Registration $8.99
Unstoppable Domains
Domain Recover
DomainEasy โ€” Payment Flexibility
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back