【问题标题】:Why can't I insert into MySQL?为什么我不能插入 MySQL?
【发布时间】:2010-02-15 15:45:15
【问题描述】:
+---------+---------+------+-----+---------+----------------+
| 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

【问题讨论】:

    标签: mysql geospatial spatial mysql-error-1416


    【解决方案1】:

    你试过了吗:

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

    【讨论】:

    • 根据bit.ly/9r97o5,这仅在 MySQL 5.1.35 之前的版本上需要。从 5.1.35 开始,可以直接插入 Point() 的返回值。
    • mySQL 中的函数名是否区分大小写?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-09-08
    • 1970-01-01
    • 1970-01-01
    • 2015-04-11
    • 1970-01-01
    • 2022-12-04
    • 1970-01-01
    相关资源
    最近更新 更多