【发布时间】:2016-03-22 12:58:22
【问题描述】:
我最近升级到 MySQL 5.7 并试图从 5.6 主服务器运行复制。但是复制失败并出现以下错误:
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;
在我看来,导入正在尝试将一些二进制数据插入多边形字段,但公平地说,我不知道如何使其工作。
有什么想法吗?
【问题讨论】:
-
我在这方面给了你一个加分......运气好吗?我有同样的问题:无法从您发送到 GEOMETRY 字段的数据中获取几何对象
-
我实际上不得不降级到 MySQL 5.6 来解决它
-
可以整天导入 5.6,没问题...但是 5.7 是不行的。
-
您的数据中是否有定义的点少于 4 个的多边形?见 - github.com/creof/doctrine2-spatial/issues/155
标签: mysql mysql-workbench mysqldump