http://qs321.pair.com?node_id=11118520


in reply to Re^14: Help with Geo::IP output
in thread Help with Geo::IP output

THANK YOU SO MUCH marto!

I had thought it wouldn't be possible to get this geoip thing to work - there were so many things missing in the puzzle:

1) The default SQLite was 2013 version and I had no idea this could be an issue. Had to download the source and compile my own binaries.

2) I didn't have DBD::SQLite installed until someone mentioned it.

3) Then there was the config file which I didn't now I could get - thought it was only for paid users.

4) And then there was the memory usage thing at the server end that stopped the --fetch processes because it was using too much RAM (someone did warn about this). The hosting made an exception for an hour to allow the command to run.

So it was an not *easy thing* to do especially for someone not too familiar with Unix.

But it's finally done now - thank you everyone for your patience and help. Thank you.

Replies are listed 'Best First'.
Re^16: Help with Geo::IP output
by Tux (Canon) on Jun 25, 2020 at 12:44 UTC

    All kinds of suggestions now committed. Note all the errors in the command line and how you get feedback:

    1. Nonexistent driver (type in driver name). You get the same error if you typed it correctly but the driver cannot load for whatever reason:

      $ perl ./geoip --no-fetch --DB=dbi:SQXLite:dbname=geoip.db Cannot continue without a working database Did you forget to install DBD::SQXLite?
    2. The dbx: part won't ever find a (standard) driver, so
    3. $ perl ./geoip --no-fetch -DB=dbx:SQLite:dbname=geoip.db Cannot continue without a working database Maybe the matching DBD for dbx:SQLite:dbname=geoip.db is not insta +lled

    I also made a few adjustments to the documentation based on marto's feedback. Thank you!

    (FWIW I have no idea what the errors will be if the machine does not have enough memory to create the database)

    Note that if you fetch new data files, you will need the memory again to load/update the database.

    For normal operation (--no-fetch) you don't need that much memory.


    Enjoy, Have FUN! H.Merijn
Re^16: Help with Geo::IP output
by marto (Cardinal) on Jun 25, 2020 at 12:06 UTC

    You didn't have to do 1., simply installing DBD::SQLite (cpanm DBD::SQLite) builds SQLite for you: "DBD::SQLite is a Perl DBI driver for SQLite, that includes the entire thing in the distribution. So in order to get a fast transaction capable RDBMS working for your perl project you simply have to install this module, and nothing else.". From there it's a case of installing the app (cpanm App::geoip), and creating a config file with the details as specified. So the following steps:

    • Read and understand the module documentation.
    • Build SQLite and the perl module DBD::SQLite: cpanm DBD::SQLite.
    • Install geoip: cpanm App::geoip.
    • Create your config file as specified in the documentation.
    • Run the app and create the database: geoip --fetch --DB=dbi:SQLite:dbname=geoip.db

    I've made a note to review the module docs in light of this thread, and if I can come up with any improvement I'll raise with Tux and see what he thinks.

      Unless I remember wrongly, I did install DBD::SQLite and then tried again with geoip. It was the same result so that was when I decided to install the new SQLite from source (with help pointed by the hosting).

      Edit to my previous post:

      3) Then there was the config file which I didn't now I could get - thought it was only for paid users.

      Should have been:

      3) Then there was the license key which I didn't know I could get from Maxmind - had thought it was only for paid users.