How to see .mmdb file content?

sam picture sam · Aug 8, 2018 · Viewed 14.1k times · Source

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

I want to see its content.

Is there any application, tool to show this .mmdb file?

Answer

scytale picture scytale · Aug 9, 2018

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.