Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Got 'Invalid syntax' error on MySQL when doing ipgeobase_update #3

Open
yeputons opened this issue Jan 1, 2012 · 1 comment
Open

Comments

@yeputons
Copy link

yeputons commented Jan 1, 2012

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.

@yeputons yeputons closed this as completed Jan 1, 2012
@yeputons yeputons reopened this Jan 3, 2012
@vladvlasov256
Copy link

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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants