List:General Discussion« Previous MessageNext Message »
From:Graham Reeds Date:June 14 2006 10:00pm
Subject: Re: Differences between MySQL 4 and 5 for scripts
View as plain text  
Dan Buettner wrote:
> Graham, I seem to recall those single quote marks working without a 
> problem on various platforms and versions of MySQL.  Of course they are 
>  generally just a nicety and only required if you are using reserved 
> words as table/column/key names, so you could just remove them entirely.
> 
> Could you post the exact error message you're getting please?

"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 ''Blog'' at line 1"
when line one is "DROP
TABLE IF EXISTS 'Blog';"

> Two thoughts -
> 
> 1) You may have a bogus hidden character in your SQL file.  If you look 
> at it with a text editor (BBEdit, TextWrangler, etc), with the "show 
> invivisbles" feature on, do you see unusual stuff?  Sounds strange but 
> I've seen stranger.

Took a brief look over it but didn't see anything that I thought looked 
untoward.  Nor did side by side comparison show up anything.

> 2) You could work around this problem a different way ...
>   - create a 5.0 database yourself using the standard supplied scripts, 
> perhaps on your own workstation
>   - dump your new database structure using mysqldump with the flag
>     --compatible=mysql40
>     which should create a file suitable for piping into a MySQL 4.0 server

That worked.

The gotchas:
* CHARSET wasn't exported as CHARACTER SET - it wasn't exported at all.
* TYPE is now ENGINE (ie TYPE=InnoDB is now ENGINE=InnoDB)
* The tables have gone from having an initial capital letter to all 
lower caps (I thought v5 was all lower caps anyway?)
* Also an error occurred regarding varchar size (it appears v5 can hold 
4096 while v4 max is 255).

Can you load a v5 server with a v4 script?

Thanks for your help!

Graham.

Thread
Differences between MySQL 4 and 5 for scriptsGraham Reeds14 Jun
  • Re: Differences between MySQL 4 and 5 for scriptsDan Buettner14 Jun
    • Re: Differences between MySQL 4 and 5 for scriptsGraham Reeds14 Jun
      • Re: Differences between MySQL 4 and 5 for scriptsJim Winstead15 Jun
      • BBEdit tip (was: Differences between MySQL 4 and 5 for scripts)Chris Sansom15 Jun
  • Re: Differences between MySQL 4 and 5 for scriptsMichael Stassen14 Jun