Unix Technical Forum

Creating a Table With a Default

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 ...


Go Back   Unix Technical Forum > Database Server Software > MySQL > MySQL General forum

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 06:06 AM
Al Sparks
 
Posts: n/a
Default Creating a Table With a Default

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


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 06:06 AM
Carlos Proal
 
Posts: n/a
Default Re: Creating a Table With a Default


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
>
>
>
>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:31 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com