I guess, that your database name is NOT "nextgen".
The import script do not use any information from the (3.x) siteaccesses. So, it does not use your DB information (server, DB-Name, user, password).
Enter the data in the settings/site.ini.append (or , if this does not work, into the ORIGINAL site.ini) and try to re-run the import script. You will see immediatly, if the import-script at least uses the correct DB settings.