ITPub博客

首页 > 数据库 > MySQL > 表中字段插入含有特殊符号的内容

表中字段插入含有特殊符号的内容

原创 MySQL 作者:风陵渡口_ 时间:2018-04-10 17:12:42 0 删除 编辑
mysql 表中字段插入含有特殊符号:
insert into a values(3,\[\["1312","1321"\]\]);
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 '1312","1321"\]\]")' at line 1


解决方法:加单引号
 insert into a values(4,'[["1312","1313","1314"]]');
 insert into a values(4,'***********"1312","1313","1314"*****');
 select * from a;
+------+--------------------------------------+
| id   | name                                 |
+------+--------------------------------------+
|    2 | game2                                |
|    4 | [["1312","1313","1314"]]             |
|    4 | ***********"1312","1313","1314"***** |
+------+--------------------------------------+

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30162734/viewspace-2152774/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: mysql_upgrade
请登录后发表评论 登录
全部评论

注册时间:2015-03-14

  • 博文量
    53
  • 访问量
    43491