MYSQL导入:无法从发送到GEOMETRY字段的数据中获取几何对象 [英] MYSQL import: Cannot get geometry object from data you send to the GEOMETRY field

查看:79
本文介绍了MYSQL导入:无法从发送到GEOMETRY字段的数据中获取几何对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have recently upgraded to MySQL 5.7 and was trying to run a replication from 5.6 master. However the replication fails with the following error:

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

原来,当我尝试从mysqldump导入数据时,也会发生这种情况.表结构如下:

Turns out it also happens when I try to import data from the mysqldump. Table structure is as follows:

 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;

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

It appears to me that the import is trying to insert some binary data into the polygon field but in fairness I have no idea how to make it work.

有什么想法吗?

推荐答案

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

If you can re-run mysqldump, try to add --hex-blob option to have all binary data exported as hex dump.

这篇关于MYSQL导入:无法从发送到GEOMETRY字段的数据中获取几何对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆