django-ipgeobase
django-ipgeobase copied to clipboard
Got 'Invalid syntax' error on MySQL when doing ipgeobase_update
I use Django (python 2.7) with MySQL on linux, and when I try to run ./manage.py ipgeobase_update I get DatabaseError 1064: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"start_ip", "end_ip", ip_block, country, city, region, district, latitude, longi' at line 2'. Removing of quotes around 'start_ip' and 'end_ip' fixes the problem. Because there're no quotes around other fields' names, I think that this won't break compatibility with other servers.
I fixed 'Invalid syntax' error by commands for MySQL console:
ALTER TABLE django_ipgeobase_ipgeobase MODIFY city VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci; ALTER TABLE django_ipgeobase_ipgeobase MODIFY region VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci; ALTER TABLE django_ipgeobase_ipgeobase MODIFY district VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci;