今天想入数据库里插入几条记录遇到了问题,不能批量插入
INSERT INTO `products_description` (`products_id`, `language_id`, `products_name`, `products_description`, `products_url`, `products_viewed`) VALUES
(1, 1, 'txt1', 'content', '', 0),
(2, 1, 'txt2', 'content2', '', 0),
(3, 1, 'txt3', 'content3', '', 0),
(4, 1, 'txt4', 'content4', '', 0);
这个语句不能执行,
害得我只能把每个数据分别来插入,
INSERT INTO `products_description` (`products_id`, `language_id`, `products_name`, `products_description`, `products_url`, `products_viewed`) VALUES
(1, 1, 'txt1', 'content', '', 0)请问是哪个地方错了吗

解决方案 »

  1.   

    mysql> INSERT INTO `products_description` (`products_id`, `language_id`, `products_name`, `products_description`, `products_url`, `products_viewed`) VALUES
        -> (1, 1, 'txt1', 'content', '', 0),
        -> (2, 1, 'txt2', 'content2', '', 0),
        -> (3, 1, 'txt3', 'content3', '', 0),
        -> (4, 1, 'txt4', 'content4', '', 0);
    Query OK, 4 rows affected (0.00 sec)
    Records: 4  Duplicates: 0  Warnings: 0没错啊  可以执行的
      

  2.   

    你的Mysql版本太低了,不支持。
    你下载一个mysql5.5的吧。