Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 12-09-2005, 11:41 PM   #1
Satisfaction
WootWootCash.com
 
Join Date: Jul 2004
Location: Australia
Posts: 10,900
Mysql Question

I'm trying to re-import a mysql dump, however it keeps giving me errors at this particular table:

CREATE TABLE `phpads_images` (
`filename` varchar(128) NOT NULL default '',
`contents` mediumblob NOT NULL,
`t_stamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
PRIMARY KEY (`filename`)
) ENGINE=INNODB DEFAULT CHARSET=latin1;


The error I'm receiving is:
"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 'defaultCURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY "

Anybody have any ideas?

Cheers
Satisfaction is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-10-2005, 12:04 AM   #2
Esbee
Confirmed User
 
Join Date: Jun 2003
Location: Northern CA
Posts: 109
Quote:
Originally Posted by Satisfaction
I'm trying to re-import a mysql dump, however it keeps giving me errors at this particular table:

CREATE TABLE `phpads_images` (
`filename` varchar(128) NOT NULL default '',
`contents` mediumblob NOT NULL,
`t_stamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
PRIMARY KEY (`filename`)
) ENGINE=INNODB DEFAULT CHARSET=latin1;


The error I'm receiving is:
"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 'defaultCURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY "

Anybody have any ideas?

Cheers
The "timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP" stuff is redundant on MySQL4.1+ - see:
http://dev.mysql.com/doc/refman/5.0/...stamp-4-1.html

Change that line to plain 'ole
......, `t_stamp` timestamp,......

... and see if it works as you expect. It should.

The ' DEFAULT CHARSET=latin1' can cause problems as well if the dump was from an older version of MySQL headed into a newer version, or the dump was generated by a 3rd-party program/script that presumes it should be there. Try dumping it as well.
Esbee is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-10-2005, 12:10 AM   #3
Deek
Registered User
 
Join Date: Nov 2005
Posts: 31
try and just put quotes around the timestamp part.

`t_stamp` timestamp NOT NULL default 'CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP',

Should fix you up.
Deek is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-10-2005, 01:08 AM   #4
IceMaster
Confirmed User
 
Join Date: Jan 2005
Posts: 8,920
First remove DEFAULT CHARSET=latin1 and try again.
IceMaster is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-10-2005, 01:41 AM   #5
lawked
Confirmed User
 
Join Date: Apr 2003
Location: Canada
Posts: 354
mysqldump --help ... look at --compatible

I'm pretty sure this is the reason it's happening, solution was posted above.
lawked is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-10-2005, 02:51 AM   #6
grumpy
Too lazy to set a custom title
 
grumpy's Avatar
 
Join Date: Jan 2002
Location: Holland
Posts: 9,870
you use php myadmin?

this is the right way


CREATE TABLE `phpads_images` (
`filename` varchar(128) NOT NULL default '',
`contents` mediumblob NOT NULL,
`t_stamp` timestamp NOT NULL ,
PRIMARY KEY (`filename`)
) ENGINE=INNODB DEFAULT CHARSET=latin1;
__________________
Don't let greediness blur your vision | You gotta let some shit slide
icq - 441-456-888
grumpy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.