phpMyAdmin export/import problem

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Steveo31
Forum Contributor
Posts: 416
Joined: Sun Nov 23, 2003 9:05 pm
Location: San Jose CA

phpMyAdmin export/import problem

Post by Steveo31 »

Hey guys-

I built a site on my home comp, and works 100% on everything. When I tried to export the DB structure to the server, it threw an error. Here's what phpMyAdmin exported:

Code: Select all

CREATE TABLE `comments` (
  `id` int(8) NOT NULL auto_increment,
  `username` varchar(30) NOT NULL default '',
  `re` varchar(50) NOT NULL default '',
  `service` int(8) NOT NULL default '0',
  `quality` int(8) NOT NULL default '0',
  `reliability` int(8) NOT NULL default '0',
  `recommend` int(8) NOT NULL default '0',
  `comment` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`id`,`re`),
  KEY `username` (`username`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
And the error when I tried it on the server:

Code: Select all

#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 'DEFAULT CHARSET=latin1 AUTO_INCREMENT=1' at line 12
If I take out the "DEFAULT", it works fine. Buuuut, I kinda need all the info there.... why wont phpMyAdmin take it's own data? I have the same version as my server does.
lostboy
Forum Contributor
Posts: 329
Joined: Mon Dec 30, 2002 8:12 pm
Location: toronto,canada

Post by lostboy »

can't say offhand why its giving you grief but consider creating the table wihtout it and then doing an alter statement to set the NLS specs that you want
Steveo31
Forum Contributor
Posts: 416
Joined: Sun Nov 23, 2003 9:05 pm
Location: San Jose CA

Post by Steveo31 »

Yea that was the best way, but man, what a pain. Wondering if this is some kind of bug or something. Just seems logical that if it creates it, it should also be able to read it. :-/
lostboy
Forum Contributor
Posts: 329
Joined: Mon Dec 30, 2002 8:12 pm
Location: toronto,canada

Post by lostboy »

could be a version difference or something unusual about the setup at the remote site
dreamline
Forum Contributor
Posts: 158
Joined: Fri May 28, 2004 2:37 am

Post by dreamline »

I had the same problem and as far as i could tell it was a version prob.. My host was running v3.23 while my system at home is running 4.x...

If you delete ENGINE=MyISAM DEFAULT CHARSET=latin1, it should work.. Worked for me though... :D
Post Reply