On Wed, Jun 14, 2006 at 11:00:36PM +0100, Graham Reeds wrote:
> 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';"

You're not quoting the table name correctly. Identifiers must be quoted
using the backtick (`), if they are quoted at all.

You should be fine with:

  DROP TABLE IF EXISTS Blog;

or
  DROP TABLE IF EXISTS `Blog`;

> >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.

Because MySQL 4.0 does not understand character sets at the table level.
(It was a new feature in MySQL 4.1.)

> * TYPE is now ENGINE (ie TYPE=InnoDB is now ENGINE=InnoDB)

ENGINE is supported as of MySQL 4.0.18.

> * The tables have gone from having an initial capital letter to all 
> lower caps (I thought v5 was all lower caps anyway?)

On systems with case-insensitive file systems, MySQL will lowercase
table and database identifiers.

> * Also an error occurred regarding varchar size (it appears v5 can hold 
> 4096 while v4 max is 255).

The maximum size of a VARCHAR is 255 bytes in MySQL 4.0, and about 64K
characters in MySQL 4.1 and later.

> Can you load a v5 server with a v4 script?

Yes, you can generally load scripts written for MySQL 4.x into
MySQL 5.x.

You may also want to use the special syntax for specifying
version-specific parts of your query:

  http://dev.mysql.com/doc/refman/5.0/en/comments.html

Jim Winstead
MySQL Inc.

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

Reply via email to