{"id":21945951,"url":"https://github.com/ip2location/docker-ip2location-mysql","last_synced_at":"2025-04-22T21:29:52.464Z","repository":{"id":22014911,"uuid":"25340664","full_name":"ip2location/docker-ip2location-mysql","owner":"ip2location","description":"This is a pre-configured, ready-to-run MySQL server with IP2Location Geolocation database setup scripts. It simplifies the development team to install and set up the geolocation database in MySQL server.","archived":false,"fork":false,"pushed_at":"2025-02-05T02:22:30.000Z","size":41,"stargazers_count":13,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-18T21:16:47.861Z","etag":null,"topics":["docker","geolocation","geolocation-database","ip-address-database","ip-database","ip-geolocation","ip2location"],"latest_commit_sha":null,"homepage":"http://www.ip2location.com","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ip2location.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-10-17T05:43:57.000Z","updated_at":"2025-02-05T02:22:33.000Z","dependencies_parsed_at":"2025-02-05T03:20:50.551Z","dependency_job_id":"384797ba-0bad-47f4-be98-e5de39ea3179","html_url":"https://github.com/ip2location/docker-ip2location-mysql","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ip2location%2Fdocker-ip2location-mysql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ip2location%2Fdocker-ip2location-mysql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ip2location%2Fdocker-ip2location-mysql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ip2location%2Fdocker-ip2location-mysql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ip2location","download_url":"https://codeload.github.com/ip2location/docker-ip2location-mysql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250327926,"owners_count":21412525,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","geolocation","geolocation-database","ip-address-database","ip-database","ip-geolocation","ip2location"],"created_at":"2024-11-29T04:20:57.322Z","updated_at":"2025-04-22T21:29:52.457Z","avatar_url":"https://github.com/ip2location.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"docker-ip2location-mysql\n========================\n\nThis is a pre-configured, ready-to-run MySQL server with IP2Location Geolocation database setup scripts. It simplifies the development team to install and set up the IP2Location geolocation database in MySQL server. The setup script supports the [commercial database packages](https://www.ip2location.com) and [free LITE package](https://lite.ip2location.com). Please register for a free or commercial account before running this image, as it requires a download token during the setup process.\n\n\n\n## Usage\n\n1. Run this image as daemon using the download token and product code from [IP2Location LITE](https://lite.ip2location.com) or [IP2Location](https://www.ip2location.com).\n\n   ```bash\n   docker run --name ip2location -d -e TOKEN={DOWNLOAD_TOKEN} -e CODE={DOWNLOAD_CODE} -e MYSQL_PASSWORD={MYSQL_PASSWORD} ip2location/mysql\n   ```\n\n   **\u003cu\u003eENV VARIABLE\u003c/u\u003e**\n\n   TOKEN - Download token obtained from IP2Location.\n\n   CODE - Database code. Codes available as below:\n\n   * Free Database - DB1-LITE, DB3-LITE, DB5-LITE, DB9-LITE, DB11-LITE\n\n   * Commercial Database - DB1, DB2, DB3, DB4, DB5, DB6, DB7, DB8, DB9, DB10, DB11, DB12, DB13, DB14, DB15, DB16, DB17, DB18, DB19, DB20, DB21, DB22, DB23, DB24, DB25, DB26\n     \n\n   IP_TYPE - (Optional) Download IPv4, IPv6 or both database. Script will download both database by default.\n\n   * IPV4 - Download IPv4 database only.\n   * IPV6 - Download IPv6 database only.\n   * BOTH - Download IPv4 \u0026 IPv6 database.   \n\n   MYSQL_PASSWORD - (Optional) Password for MySQL admin. A random password will be generated by default.\n\n   \n\n2. The installation may take seconds to minutes depending on your database sizes, downloading speed and hardware specs. You may check the installation status by viewing the container logs. Run the below command to check the container log:\n\n        docker logs -f ip2location\n\n    You should see the line of `=\u003e Setup completed` if you have successfully complete the installation. Also, you should notice the generated password for the MySQL admin login as below:\n\t\n\t    mysql -u admin -p{MYSQL_PASSWORD} ip2location_database\n\t\n\tPlease write down the password somewhere else, as you will need it later for MySQL connection.\n\n\n\n## Connect IP2Location database from a container\n\n    docker run --link ip2location:ip2location-db -t -i application_using_the_ip2location_data\n\nPlease note that `--link` flag has become the legacy feature of Docker and may eventually be removed. Please use the network bridge to link containers for query. You can read this article of How to connect [IP2Location MySQL docker in Debian container](https://blog.ip2location.com/knowledge-base/how-to-connect-ip2location-mysql-docker-in-debian-container/) to learn more.\n\n\n\n## Query for IP information\n\nBelow is an example of how to lookup for information of 8.8.8.8 IP address.\n\n```mysql\nmysql -u admin -p{MYSQL_PASSWORD} -h ip2location-db ip2location_database -e 'SELECT * FROM `ip2location_database` WHERE INET6_ATON(\"8.8.8.8\") \u003c= ip_to LIMIT 1'\n```\n\n\n\n## Update IP2Location Database\n\nTo update your IP2Location database to latest version, please run the following  command:\n\n```\ndocker exec -it ip2location ./update.sh\n```\n\n\n\n## Articles and Tutorials\n\nYou can visit the below link for more information about this docker image:\n[IP2Location Articles and Tutorials](https://blog.ip2location.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fip2location%2Fdocker-ip2location-mysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fip2location%2Fdocker-ip2location-mysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fip2location%2Fdocker-ip2location-mysql/lists"}