Alla-amin wrote:
So far this was what I did,

Took all files i.e frm, MYI and MYD files from the new
server. Created a database like on another box running
the version of mysql the old server was running and
pasted them in the data folder of the database I
created and viola - they all showed up, so i think it
was a compatability issue.

Now - I don't want to un-install mysql on the new
server so I did a dump from the test server and tried
to import it but it encountered some errors on the way
and imported only 9 tables out of 14.

So, I dumped table by table and imported table by
table and was able to import 12 tables and found out
the tables that were giving problems. They are syntax
errors, however - I have been battling with them over
the past 8 hours, everything seems right to me and
they run on the old version of mysql I copied the frm,
MYD and MYI files to - but when I did a dump to the
same server on another database or the new server - it
gives the ff errors.


1.
CREATE TABLE xrates (
  date date default NULL,
  time time NOT NULL default '00:00:00',
  amount_from decimal(15,5) NOT NULL default
'0.00000',
  currency_from char(6) NOT NULL default '',
  amount_to decimal(15,5) NOT NULL default '0.00000',
  currency_to char(6) NOT NULL default '',
  order tinyint(1) unsigned NOT NULL default '0',
  UNIQUE KEY date (date,currency_from,currency_to)
) TYPE=MyISAM;


MySQL says

ERROR 1064: You have an error in your SQL syntax near
'order tinyint(1) unsigned NOT NULL default '0',
  UNIQUE KEY date (date,currency' at line 8

order is a reserved word (ORDER BY). You'll have to change the column name or quote it (with backticks) nearly *every* time you use it.

   `order` tinyint(1) unsigned NOT NULL default '0',

2.
CREATE TABLE user_log (
  id mediumint(8) NOT NULL auto_increment,
  number varchar(7) NOT NULL default '',
  when timestamp(14) NOT NULL,
  what varchar(255) NOT NULL default '',
  PRIMARY KEY  (id)
) TYPE=MyISAM;

MySQL says

ERROR 1064: You have an error in your SQL syntax near
'when timestamp(14) NOT NULL,
  what varchar(255) NOT NULL default '',
  PRIMARY ' at line 4

when is also a reserved word (CASE...WHEN...).  Change it or quote it:

   `when` timestamp(14) NOT NULL,

Plz assist.

See the manual for more <http://dev.mysql.com/doc/mysql/en/reserved-words.html>.

Michael

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to