This is a discussion on Creating a Table With a Default within the MySQL General forum forums, part of the MySQL category; --> I'm trying to install ProBIND, and I'm running mysql 4.1.20. One of the ProBIND install scripts calls for tables ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I'm trying to install ProBIND, and I'm running mysql 4.1.20. One of the ProBIND install scripts calls for tables to be created in MySQL, and I've culled it down to this: mysql> CREATE TABLE zones ( -> id INT(11) DEFAULT '1' NOT NULL AUTO_INCREMENT, -> PRIMARY KEY (id) -> ); ERROR 1067 (42000): Invalid default value for 'id' I've tried double quotes, changing it to INT(1), and still I get that error. Any hints? === Al |
| ||||
| It makes no sense to use a default value with an auto_increment attribute, which means, the default value is the auto-incremented value. Carlos Al Sparks wrote: > I'm trying to install ProBIND, and I'm running mysql 4.1.20. > > One of the ProBIND install scripts calls for tables to be created in MySQL, and I've culled it down to this: > > mysql> CREATE TABLE zones ( > -> id INT(11) DEFAULT '1' NOT NULL AUTO_INCREMENT, > -> PRIMARY KEY (id) > -> ); > ERROR 1067 (42000): Invalid default value for 'id' > > > I've tried double quotes, changing it to INT(1), and still I get that error. > > Any hints? > === Al > > > > |