[wellylug] Weird MySQL problem.

Jethro Carr jethro.carr at jedolinux.com
Sat May 14 11:04:05 NZST 2005


On Sat, 2005-05-14 at 10:13, wellylug at addict.net.nz wrote:
> > Normally, to restore it I use 'mysql < BACKUPFILE.SQL'. However, for
> > some strange reason when I try to do it now, I get the error message
> > below:
> >
> > -----------------------------------------------------------------
> > [root at amber sqlbackups]# mysql < sqlbackup-01-05-05.sql
> > ERROR 1064 at line 19: 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 '-comments (
> >   id int(11) NOT NULL auto_increment,
> >   date dateti
> > [root at amber sqlbackups]#
> > -------------------------------------------------------------------
> 
> The above is due to the dash/hyphen in the table name, which MySQL doesn't
> like.



Ahh! I think I've found the problem.

For some reason, mysql didn't surrond the table names with back quotes
(ie: `table-name`) when it got exported. When I add a table containing a
dash with backquotes it works!

strange...




-- 
-- Jethro Carr

jethro.carr at jedolinux.com

http://jethrocarr.jedolinux.com
http://jethrocarr.jedolinux.com/index.php?page=cv/cv.php

http://www.jedolinux.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.wellylug.org.nz/pipermail/wellylug/attachments/20050514/f9eb7a7a/attachment.pgp 


More information about the wellylug mailing list