Code Address:Github.com/chinlee1523…
This tool provides the data of five administrative levels of provinces, cities, counties, towns and villages in mainland China. The data comes from the Internet for everyone to use.
There are two formats

1 kind

Put all the data in a table, table structure
CREATE TABLE `administration` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `province_id` bigint(20) unsigned NOT NULL,
   `province_name` char(64) NOT NULL,
   `city_id` bigint(20) unsigned NOT NULL,
   `city_name` char(64) NOT NULL,
   `county_id` bigint(20) unsigned NOT NULL,
   `county_name` char(64) NOT NULL,
   `town_id` bigint(20) unsigned NOT NULL,
   `town_name` char(64) NOT NULL,
   `village_id` bigint(20) unsigned NOT NULL,
   `village_name` char(64) NOT NULL,
   PRIMARY KEY (`id`),
   UNIQUE KEY `village_id` (`village_id`)
 ) ENGINE=InnoDB AUTO_INCREMENT=668390 DEFAULT CHARSET=utf8 COMMENT='Data of Provinces, cities, counties, Towns and Villages';Copy the code

2 kinds of

The data of province, city, county, town and village were put in 5 tables respectively.