由于我升级到 Django 1.4.5 并删除并重新创建了 MySQL 5.5.8
数据库,我在 ./managesyncdb
上收到此错误消息
Superuser created successfully.
Installing custom SQL ...
Installing indexes ...
Failed to install index for my_app.WorldBorder model:
(1464, "The used table type doesn't support SPATIAL indexes")
设置:
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.gis', <---- here
'pipeline',
'widget_tweaks',
'my_app',
'south',
'modeltranslation',
'djcelery',
)
但我已经下载并编译了 Geos,到目前为止它一直有效:
wget http://download.osgeo.org/geos/geos-3.3.0.tar.bz2
tar xjf geos-3.3.0.tar.bz2
auto-apt run ./configure
make -j4
sudo checkinstall
sudo ldconfig
我错过了什么吗?
最佳答案
如果数据库类型不是 myisam,创建空间索引会返回错误:
错误 1464 (HY000):使用的表类型不支持 SPATIAL 索引
您可以将数据库类型更改为 myisam,此示例将通过执行以下操作来工作:
alter table geom engine=myisam;
如需引用,请查看此处的文档 http://dev.mysql.com/doc/refman//5.5/en/creating-spatial-indexes.html
关于mysql - Django 1.4.5 - 无法安装 WorldBorder 模型的索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15140785/