gpt4 book ai didi

mysql - 为什么我的 mysql 服务器上不存在某些空间函数?

转载 作者:行者123 更新时间:2023-12-05 09:11:13 34 4
gpt4 key购买 nike

我已经安装了一个新的本地 MySQL 服务器(Version8)供开发使用。我想使用空间函数,但其​​中一些不存在。

这个脚本返回了一个很好的值:

create database test;
use test;
select st_x(point(15, 20));

15

所以,虽然空间扩展是 native 安装的,但只要我使用其他函数,如 geomfromtext,我的脚本就会抛出错误:

create database test;
use test;
SELECT geomfromtext('Point(15 20)');

Error Code: 1305. FUNCTION test.geomfromtext does not exist 0.000 sec

我不明白,MySQL Workbench 控制台的自动完成完成几何。 Autocompletion

我在安装过程中忘记了哪一步?

最佳答案

我刚刚飞过 official documentation似乎该函数称为 ST_GeomFromText()在 MySQL 8.0 中。

In MySQL 5.7, several spatial functions available under multiple names were deprecated to move in the direction of making the spatial function namespace more consistent, the goal being that each spatial function name begin with ST_ if it performs an exact operation, or with MBR if it performs an operation based on minimum bounding rectangles. In MySQL 8.0, the deprecated functions are removed to leave only the corresponding ST_ and MBR functions:

  • These functions are removed in favor of the MBR names: Contains(), Disjoint(), Equals(), Intersects(), Overlaps(), Within().
  • These functions are removed in favor of the ST_ names: Area(), AsBinary(), AsText(), AsWKB(), AsWKT(), Buffer(), Centroid(), ConvexHull(), Crosses(), Dimension(), Distance(), EndPoint(), Envelope(), ExteriorRing(), GeomCollFromText(), GeomCollFromWKB(), GeomFromText(), GeomFromWKB(), GeometryCollectionFromText(), GeometryCollectionFromWKB(), GeometryFromText(), GeometryFromWKB(), GeometryN(), GeometryType(), InteriorRingN(), IsClosed(), IsEmpty(), IsSimple(), LineFromText(), LineFromWKB(), LineStringFromText(), LineStringFromWKB(), MLineFromText(), MLineFromWKB(), MPointFromText(), MPointFromWKB(), MPolyFromText(), MPolyFromWKB(), MultiLineStringFromText(), MultiLineStringFromWKB(), MultiPointFromText(), MultiPointFromWKB(), MultiPolygonFromText(), MultiPolygonFromWKB(), NumGeometries(), NumInteriorRings(), NumPoints(), PointFromText(), PointFromWKB(), PointN(), PolyFromText(), PolyFromWKB(), PolygonFromText(), PolygonFromWKB(), SRID(), StartPoint(), Touches(), X(), Y().

  • GLength() is removed in favor of ST_Length().

关于mysql - 为什么我的 mysql 服务器上不存在某些空间函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60377271/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com