自从我升级到Django 1.4.5并删除并重新创建MySQL 5.5.8
数据库后,我在./manage syncdb
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
我错过了什么吗?
答案 0 :(得分:1)
如果数据库类型不是myisam,则创建空间索引会返回错误:
错误1464(HY000):使用的表类型不支持SPATIAL索引
您可以将数据库类型更改为myisam,此示例将通过执行以下操作来实现:
alter table geom engine=myisam;
供参考,请查看此处的文档http://dev.mysql.com/doc/refman//5.5/en/creating-spatial-indexes.html