How to see .mmdb file content? [closed]
Asked Answered
H

1

19

I have a file GeoLite2-City.mmdb which is MaxMind DB File.

I want to see its content.

What is a way to see the content of this .mmdb file? Does MaxMind offer a tool or a library to be able to read such files?

Horwath answered 8/8, 2018 at 9:0 Comment(1)
Why don't you just download the CSV file?Innocency
C
17

See Maxmind's mmdb file specification.

mmdb databases are self contained "search tree indexed files" so you cannot just sequentially read and display the file record by record (even its "data records" include pointers to other "cache" data records that contain the actual human readable strings such as country name). So the sort of view provided by text editors is no use - you need an equivalent of the "table" row viewer for MySQL in phpMyAdmin allowing both "sequential" display or look-up by IP.

As far as I am aware no such viewer is available. They are huge files and if you just wish to view out of interest then its not worth the effort.

A capable programmer could write their own viewer, but I would describe the task as challenging (and I started programming creating and navigating suites of indexed sequential files on a pre-DBMS IBM mainframe). Maxmind's post on building (and reading) your own MMDB will provide useful pointers.

The above specification contains links to Reader Libraries/Packages in various languages and you could use or add to these existing Reader functions (e.g. for PHP Reader see Reader.php and Decoder.php)

For "sequential" display you will need to iterate through the file (e.g. Perl: iterate_search_tree ). I'm not sure if an equivalent function is directly built in to all of Maxminds Readers or whether you will have to extend.

Corkscrew answered 9/8, 2018 at 10:9 Comment(1)
If it's a search tree shouldn't a simple dfs search return a sequential result?!Sushi

© 2022 - 2024 — McMap. All rights reserved.