On Thu, 15 Apr 2010 09:31:04 Mike Diehl wrote: > I just created a new table called "lines." I can use Open Office to read > the records in it just fine. > > However, when I type this command at the cli, I get an error: > > > select * from lines; > ERROR 1064 (42000): 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 'lines' at line 1
Lines is a reserved keyword (e.g. like in "LINES TERMINATED BY"), so it must be quoted: test> use test; Database changed test> CREATE TABLE `lines` (id int unsigned NOT NULL PRIMARY KEY) ENGINE=InnoDB; Query OK, 0 rows affected (0.20 sec) test> SELECT * FROM lines; ERROR 1064 (42000): 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 'lines' at line 1 test> SELECT * FROM `lines`; Empty set (0.01 sec) Best regards, Jesper