MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old March 30th, 2006, 11:10 AM
Ron Smith Ron Smith is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2006
Posts: 3 Ron Smith User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 53 sec
Reputation Power: 0
What am I doing wrong?

I didn't think it could get much simpler than this but it is giving me an error and I don't understand why.

mysql> create table fubar (foo timestamp default current_timestamp);

ERROR 1064: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'current_timestamp)' at line 1


I am running MySQL 4.0.25-standard on Mac OS X 10.4

Reply With Quote
  #2  
Old March 30th, 2006, 12:29 PM
infamous-online infamous-online is offline
Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 404 infamous-online User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 24 m 44 sec
Reputation Power: 7
did you install the mysql odbc connectors before installing mysql?
__________________
Apache Expert

Reply With Quote
  #3  
Old March 30th, 2006, 05:16 PM
Ron Smith Ron Smith is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2006
Posts: 3 Ron Smith User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 53 sec
Reputation Power: 0
No, after but I am not using ODBC for this. I am just using the standard mysql command-line app.

Did just installing the ODBC drivers break something?

Reply With Quote
  #4  
Old March 30th, 2006, 08:13 PM
infamous-online infamous-online is offline
Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 404 infamous-online User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 24 m 44 sec
Reputation Power: 7
you install the odbc connector before you install mysql, once you've done this, then you'll be able to connect to the database server

Reply With Quote
  #5  
Old March 30th, 2006, 08:48 PM
Ron Smith Ron Smith is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2006
Posts: 3 Ron Smith User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 53 sec
Reputation Power: 0
I can connect just fine. Its just a syntax error after I get connected. Someone just informed me that "default current_timestamp" is not available prior to version 4.1.

Here is the relevant text from the user manual:

Quote:
The following items summarize the pre-4.1.2 properties for TIMESTAMP initialization and updating:

The first TIMESTAMP column in table row automatically is set to the current timestamp when the record is created if the column is set to NULL or is not specified at all.

The first TIMESTAMP column in table row automatically is updated to the current timestamp when the value of any other column in the row is changed, unless the TIMESTAMP column explicitly is assigned a value other than NULL.

If a DEFAULT value is specified for the first TIMESTAMP column when the table is created, it is silently ignored.

Other TIMESTAMP columns in the table can be set to the current TIMESTAMP by assigning NULL to them, but they do not update automatically.

As of 4.1.2, you have more flexibility in deciding which TIMESTAMP column automatically is initialized and updated to the current timestamp.


So, it seems that I can only get the behavior I desire by setting the first TIMESTAMP column to DEFAULT NULL.

Reply With Quote
  #6  
Old May 17th, 2006, 03:46 AM
Thrash Thrash is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2006
Posts: 2 Thrash User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 29 sec
Reputation Power: 0
I'm having the same problem. My first issue was with "latin1" or whatever, so I removed it and now I get this error we're speaking of.

Let me make sure I understand this:
If I make the first instance of:
Quote:
`pn_refresh` int(11) unsigned NOT NULL default '0',
`pn_last_update` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`pn_language` varchar(30) NOT NULL default '',
PRIMARY KEY (`pn_bid`)
) ENGINE=MyISAM;


I need to make:
Quote:
`pn_refresh` int(11) unsigned NOT NULL default '0',
`pn_last_update` timestamp NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`pn_language` varchar(30) NOT NULL default '',
PRIMARY KEY (`pn_bid`)
) ENGINE=MyISAM;


Or am I wrong?
... do I have to do it to ALL of the tags?
I'm changing hosts from 4.1.x to 4.0.25-standard ...
... obviously I'm using PostNuke (0.75)

(I wish I knew of all of this to begin with, I'd have never gone back!)

Reply With Quote
  #7  
Old May 18th, 2006, 04:57 AM
Thrash Thrash is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2006
Posts: 2 Thrash User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 29 sec
Reputation Power: 0
Quote:
Originally Posted by Thrash
I'm having the same problem. My first issue was with "latin1" or whatever, so I removed it and now I get this error we're speaking of.

Let me make sure I understand this:
If I make the first instance of:


I need to make:


Or am I wrong?
... do I have to do it to ALL of the tags?
I'm changing hosts from 4.1.x to 4.0.25-standard ...
... obviously I'm using PostNuke (0.75)

(I wish I knew of all of this to begin with, I'd have never gone back!)


Well, I made it "NULL" and there's no change; there's still errors!
HELP!
I just want my site up!

In fact, if anyone can take my DB and help me, I'll PAY YOU for your services!

... let me know!
(No fooling!)

Reply With Quote
  #8  
Old May 18th, 2006, 07:21 AM
Icon's Avatar
Icon Icon is offline
Command Line Warrior
Click here for more information
 
Join Date: Sep 2005
Posts: 620 Icon User rank is Private First Class (20 - 50 Reputation Level)Icon User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 1 Day 22 h 17 m 7 sec
Reputation Power: 3
<snip>
sorry, missed a reply which already stated what I wanted to say, can we delete posts?

Last edited by Icon : May 18th, 2006 at 07:24 AM. Reason: I should read more carefully

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > What am I doing wrong?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway