mysql POINT 列 - 正在尝试设置新字段

mysql POINT column - trying to set up a new field

我正在尝试更新我的脚本,以便它使用 POINT 值而不是 Latitude/Longitude 列,以尝试帮助我进行地理搜索(距离范围)。所以我有这个专栏:

`point_test` point DEFAULT NULL

..我正在尝试将其设置为:

UPDATE glinks_Links SET 
    point_test = POINT(52.35462 4.88227) WHERE ID = 3693134

但它给出了 mySQL 错误:

#1064 - 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 '4.88227) WHERE ID = 3693134' at line 2

我找到了一篇关于空间点的博客 post,它建议 运行 这个:

SELECT * FROM INFORMATION_SCHEMA.ST_SPATIAL_REFERENCE_SYSTEMS 

但是我得到这个错误:

#1109 - Unknown table 'ST_SPATIAL_REFERENCE_SYSTEMS' in information_schema

我是否需要在 mysql.conf 文件中打开空间?

仅供参考,我是 运行 mySQL Ver 14.14 Distrib 5.7.27

在您的更新语句中,您遗漏了一个逗号。查询应该如下,经度和纬度之间用逗号分隔:

UPDATE glinks_Links SET point_test = POINT(52.35462, 4.88227) WHERE ID = 3693134;