You have an error in your SQL syntax near '-------------

3.9.13. You have an error in your SQL syntax near '-------------

When you try to create the database tables with the nuke.sql file (see Section 3.2.4), you get an error:

--
---------------------------------------------------------
-- 
-- 
CREATE TABLE confirm (
  confirm_id char(32) NOT NULL default ",
  session_id char(32) NOT NULL default ",
  code char(6) NOT NULL default ",
  PRIMARY KEY  (session_id,confirm_id)
) TYPE=MyISAM
MySQL said:
You have an error in your SQL syntax near '---------------------------------------------------------
-- 
-- 
CREATE TABLE co' at line 2

This is because your nuke.sql file came with nice, useless long lines containing dashes, like these ones:

---------------------------------------------------------

Just use a decent text editor (see Chapter 11) and delete that long line, or put a # in front of it. If that doesn't help, put a # in front of every line that starts with a dash, making it a comment. SQL accepts "--" as the string that starts a comment, but it seems that MySQL does not like the rest of the dashes (after the first two ones) as a comment.

 

Site Info v2.2.2

Last SeenLast Seen
Server TrafficServer Traffic
  • Total: 339,013,237
  • Today: 41,199
Server InfoServer Info
  • Oct 19, 2017
  • 03:03 pm PDT
 
 

Daily Inspiration