Hugh Sasse <hgs@stripped> wrote on 13/10/2005 16:27:44:
> I'm fairly new to MySQL and am getting an error messages like:
> ERROR 1064 (42000) at line 5: 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 '"id" int(14) unsigned NOT NULL
> "forename" varchar(40) NOT NU' at line 2
> neelix hgs 18 %>
> So it doesn't tell me exactly where, or what the nature of the
> syntax error is (and it can't even tell me it is version 4.1.13
> which I know already). It has truncated the second line, so it's not
> that the rest is missing. My editor's syntax highlighter doesn't
> show anything awful. This is actually for lines 7 and 8 of the
> input, the first 4 lines being comments, so the numbering in the
> output is wrong.
> Are there any tools (like lint for C) to be more verbose and helpful
> about this?
No, I don;'t think there are any such tools.
When you get this sort of message, the error is nearly always *just
before* the quoted bit. Which means that you have to get hold of the full
command line that you sent and find out what immediately preceded the
characters it has given as an error.