RepositoryPHP
RA

raramuridesign/mysql-country-list

mysql insert country list into database

479stars
649forks
0issues
0views

MYSQL Country & Nationality List Imports

Use this repository to import comprehensive lists of countries and nationalities into your database or application.

Features

  • Multiple Formats: MySQL, JSON, PHP arrays, Python tuples, Joomla custom fields
  • Comprehensive Data: Basic country info, detailed geographic data, time zones, nationalities
  • Standardized Codes: ISO 3166-2, ISO 3166-3, and numeric codes
  • Flag Assets: SVG flags for all countries and territories
  • Regular Updates: Maintained to reflect current international standards

Quick Start

Database Import

# Import basic country list
mysql -u username -p database < country-lists/mysql-country-list.sql

# Import detailed country information
mysql -u username -p database < country-lists/mysql-country-list-detailed-info.sql

PHP Usage

<?php
include 'country-lists/php-country-list-array.php';
$countries = $arr; // Ready to use associative array
?>

JavaScript/Web Usage

// Fetch country data
fetch('country-lists/json-country-list.json')
  .then(response => response.json())
  .then(countries => {
    // Use country data in your application
  });

Available Data

Country Lists

FormatFileDescription
MySQL Basicmysql-country-list.sqlCountry codes and names
MySQL InnoDBmysql-country-list-InnoDB.sqlOptimized for InnoDB tables
MySQL Detailedmysql-country-list-detailed-info.sqlGeographic, currency, and language data
JSONjson-country-list.jsonStructured country data
JSON Extendedjson-country-list-V2-name-alpha2-3-numeric.jsonFull ISO codes and names
PHP Arrayphp-country-list-array.phpPHP associative array
Python Tuplepython-country-list-array.pyDjango-compatible choices
Joomla Fieldjson-country-list-joomla-custom-field.jsonJoomla CMS integration

Additional Data

  • Nationalities: Separate nationality lists for applications requiring distinction
  • Time Zones: Country-specific time zone data with GMT offsets
  • Flags: SVG flag assets for all countries and territories

Data Standards

All data follows international standards:

  • ISO 3166-1: Country codes and names
  • ISO 3166-2: Subdivisions and regions
  • ISO 4217: Currency codes
  • ISO 639: Language codes

Flag Assets

SVG flags are provided in flags/svg/ directory:

  • Standard country flags
  • Regional variants (UK nations, Caribbean Netherlands)
  • Optimized for web use

Time Zone Integration

Import time zone data for location-aware applications:

SOURCE time-zones/time-zone-import.sql;

API Integration

For programmatic access, consider:

Contributing

We welcome contributions! Please:

  1. Report data inaccuracies with reliable sources
  2. Suggest format improvements
  3. Propose new data fields
  4. Test changes across all formats

Development Setup

# Clone repository
git clone https://github.com/your-repo/mysql-country-list.git
cd mysql-country-list

# Check data consistency
# (Add validation scripts as needed)

Maintenance Notes

  • Outdated Names: Some legacy names are preserved with notes (e.g., "Netherlands Antilles (dissolved)")
  • Data Sources: Regularly updated from ISO standards and official registries
  • Compatibility: Tested across MySQL 5.7+, PHP 7.0+, Python 3.6+

License

MIT License - see MIT-License file for details.

Credits

Maintained by: raramuridesign.com

Data Sources:

  • ISO 3166 International Standards
  • United Nations Geoscheme
  • Geonames Database
  • Flagpack (SVG flags)

Related Projects:


For detailed documentation, see docs/ directory.

Similar Projects

Discover other similar projects and AI models.

RepositoryPHP
lwwcas/laravel-countries

Laravel country database package with Eloquent models, ISO 3166 codes, country flags, GeoJSON maps, phone codes, currencies and translations in 9 languages. Built with migrations & seeders for Laravel 10–13.

132
Jul 16, 2026
RepositoryHTML
lipis/flag-icons

:flags: A curated collection of all country flags in SVG — plus the CSS for easier integration

12.6k
Nov 25, 2026
RepositoryHTML
HatScripts/circle-flags

A collection of 400+ minimal circular SVG country, state and language flags

1.6k
Dec 1, 2026
RepositoryAstro
risan/country-flag-emoji-json

Country flag emojis in JSON format.

177
Oct 1, 2026
RepositoryC#
nager/Nager.Country

Complete .NET library for worldwide country data: ISO codes, currencies, languages, regions, borders & translations for 250+ countries.

170
Nov 30, 2026
RepositoryPython
porimol/countryinfo

A lightweight Python library for accessing comprehensive country data — including ISO codes, states/provinces, capital cities, currencies, languages, and other geographic information.

165
Nov 29, 2026
RepositoryJavaScript
thekelvinliu/country-code-emoji

convert country codes (ISO 3166-1 alpha-2) to corresponding emoji flags (unicode regional indicator symbols)

142
Jul 19, 2023
RepositorySwift
NikKovIos/NKVPhonePicker

An UITextField subclass to simplify country code's picking. Swift 5.0

142
Sep 9, 2021
RepositoryJavaScript
kapowaz/square-flags

A collection of 400+ minimalist square SVG country, state and language flags

105
Jul 23, 2026