MYSQL 导入:无法从发送到 GEOMETRY 字段的数据中获取几何对象

2024-01-22

我最近升级到 MySQL 5.7,并尝试从 5.6 master 运行复制。但是复制失败并出现以下错误:

Error 'Cannot get geometry object from data you send to the GEOMETRY field' on query.

事实证明,当我尝试从 mysqldump 导入数据时也会发生这种情况。表结构如下:

 CREATE TABLE `locations` (
  `location_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `country_id` int(10) unsigned NOT NULL,
  `name` varchar(100) CHARACTER SET utf8 NOT NULL,
  `locations_type_id` int(11) unsigned NOT NULL,
  `parent_id` int(11) unsigned DEFAULT NULL,
  `importance` decimal(3,2) NOT NULL DEFAULT '1.00',
  `lat` decimal(10,7) DEFAULT NULL,
  `lng` decimal(10,7) DEFAULT NULL,
  `radius` decimal(6,3) DEFAULT NULL,
  `polygon` polygon DEFAULT NULL,
  PRIMARY KEY (`location_id`),
  KEY `name` (`name`,`locations_type_id`,`parent_id`,`lat`,`lng`),
  KEY `locations_type_id` (`locations_type_id`),
  KEY `name_2` (`name`(8)),
  KEY `country_id` (`country_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

在我看来,导入正在尝试将一些二进制数据插入多边形字段,但公平地说,我不知道如何使其工作。

有任何想法吗?


如果您可以重新运行 mysqldump,请尝试添加 --hex-blob 选项以将所有二进制数据导出为十六进制转储。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

MYSQL 导入:无法从发送到 GEOMETRY 字段的数据中获取几何对象 的相关文章

随机推荐