Full SQL dump of cities and states data. There are three tables in all: states, cities, and cities_extended. All packaged in a nice (less then 1MB) ZIP file for your convenience!
If you’ve found this post you are more than likely searching for a quick and easy SQL dump of USA cities and states to add to your project. I do not claim this data to be my own, like you, I was also searching online for a simple SQL dump, only to find pages that took forever to load and dumps that I had to copy and paste, what a pain.
The Goods
states (state, state_code)
cities (city, state_code)
cities_extended (city, state_code, zip, latitude, longitude, county)
This is the extended version of the cities table allowing you to do a lot more cool things with the additional data provided (think google maps, geocoding, distance calculators, etc.)
Download
US Cities and States (880 KB)
Thanks for sharing with us
all the props – you have save me a great deal of time
Thanks a lot!
thanks you very much,
it was very help full
非常感谢 (Thanks)
thanks a mil. the cities_extended doesnt have a key primary field.. if people need this (should really) here is the code to add it in phpmyadmin etc.
ALTER TABLE cities_extended AUTO_INCREMENT = 0;
ALTER TABLE cities_extended ADD id INT NOT NULL AUTO_INCREMENT KEY;
Thanks for your kind help…. its really very useful and usable….:)
thanks a lot, this is very helpful
Hi, Thank you so much. It helps me a lots.
thanks a lot man!
Thanksssssssssssssss
Thank you so much for this great DB!
Thanks so much for sharing this.
It help me a lot.
🙂
Thanks so much for sharing this.
It help me a lot too )
Great 🙂 thanks for sharing.
Thanks A ton, my friend 🙂
Its really helps man. thanks a lot. 🙂
thanks a ton man…….
hi,
how would i go about importing this into a wordpress database in order to use it like a directory? thanks.
Thank you very much! Data like this is so tedious to collect and insert. You should consider creating a repository for this.
@jer
phpmyadmin is probably the tool you are looking for.
Holly Shit! You’ve made my day…!
Thanks
I used your SQL for my web site: Distance calculator and I have to say thank you for sharing this.
Very handy sql data to use in projects, thanks again!
Thanks a million. This is the only listing of US cities in a downloadable file I found, period. -Marc
thanks a lot, and thank you for sharing this
Thx a lot! I’ll be using it for my website. It’s very usefull!
And yes, cities_extended should have ID key or something 😉
Very thanks dude.
Thanks for sharing 🙂 Its gonna make life designing sites that need a state and city search much quicker to set up the database.. cheers!
this is really useful,
but how can i get such resource (Cities and State SQL Dump) for every other country.
Try geonames.org or List of cities by country