On Thu, 13 Oct 2005, Alec.Cawley@stripped wrote:
> 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
> auto_increment,
> > "forename" varchar(40) NOT NU' at line 2
> > neelix hgs 18 %>
> >
[...]
> >
> > 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
That's the first line of a create Table:
CREATE TABLE IF NOT EXISTS students(
"id" int(14) unsigned NOT NULL auto_increment,
"forename" varchar(40) NOT NULL default '',
"surname" varchar(40) NOT NULL default '',
[...]
> command line that you sent and find out what immediately preceded the
> characters it has given as an error.
It would be helpful if it could spit out "expected %s", which would
give some more clues.... I know that parsers are difficult to get
right, however
>
> Alec
>