为什么 POINT() 被存储为 ??*??E@z?3M??Q?在 mysql table

Why is POINT() being stored as ??*??E@z?3M??Q? in mysql table

我不明白为什么 MySQL GIS 中的 POINT 数据类型被插入为 ??*??E@z?3M??Q?

我的代码如下。任何帮助将不胜感激,我花了很长时间修补和阅读文档。先感谢您!

我的查询:

insert into locations values(null, POINT(43.005895, -71.013202), 'Car wash');

我的table:

CREATE TABLE locations (
  location_id int(10) unsigned NOT NULL AUTO_INCREMENT,
    coordinates point NOT NULL,
    name varchar(20) NOT NULL,
  PRIMARY KEY (location_id)
     ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1

您可以使用 ST_AsText() 将 GIS 数据从内部格式转换为 WKT 字符串:

SELECT location_id, ST_AsText(coordinates) as coordinates, name
FROM locations