Why can't I insert into MySQL?

淺唱寂寞╮ 提交于 2019-12-21 16:23:18

问题


+---------+---------+------+-----+---------+----------------+
| Field   | Type    | Null | Key | Default | Extra          |
+---------+---------+------+-----+---------+----------------+
| id      | int(11) | NO   | PRI | NULL    | auto_increment |
| user_id | int(11) | NO   | UNI | NULL    |                |
| utm     | point   | NO   | MUL | NULL    |                |
+---------+---------+------+-----+---------+----------------+

insert into life(user_id, utm)  values(99,point(4,4));

ERROR 1416 (22003): Cannot get geometry object from data you send to the GEOMETRY field

回答1:


Have you tried:

insert into life(user_id, utm)  values(99,PointFromWKB(POINT(4,4)));


来源:https://stackoverflow.com/questions/2267034/why-cant-i-insert-into-mysql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!