错误1064(42000)SQL插入

时间:2015-01-28 02:40:00

标签: mysql

我已经查看了很多关于此主题的其他问题,但仍无法弄清楚我的代码在SQL中的错误。我创建了一个名为easy_drinks的表,当我尝试插入一条记录时,它给了我一个错误。有人可以向我解释错误吗?另外,如果我找不到问题,将来调试此类错误的最佳方法是什么?

mysql> DESC easy_drinks;
+------------+--------------+------+-----+---------+-------+
| Field      | Type         | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+-------+
| drink_name | varchar(40)  | NO   |     | NULL    |       |
| main       | varchar(20)  | NO   |     | NULL    |       |
| amount1    | decimal(4,2) | NO   |     | NULL    |       |
| second     | varchar(20)  | NO   |     | NULL    |       |
| amount2    | decimal(4,2) | NO   |     | NULL    |       |
| directions | blob         | NO   |     | NULL    |       |
+------------+--------------+------+-----+---------+-------+
6 rows in set (0.00 sec)

mysql> INSERT INTO easy_drinks (drink_name, main, amount1, second, amount2, directions) VALUES (‘Blackthorn’, ‘tonic water’, 1.5, ‘pineapple juice’, 1, ‘stir with ice, strain into cocktail glass with lemon twist’);

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 'water’, 1.5, ‘pineapple juice’, 1, ‘stir with ice, strain into c' at line 1

我正在运行MySQL版本5.6.22

1 个答案:

答案 0 :(得分:0)

将引号从`替换为'