Move-blogs.php script produces db-error (could not list tables)

I am scaling up from one to 256 db, currently trying to execute the "move-blogs"-script. It produces this error:

DB Error, could not list tables
Make sure you configure your original table in the dbname variable at the top of the script!
MySQL Error: Unknown database 'old_db_name'

Here is how my script looks:

///DB Settings
$dbname = "jungleprod_"; //This is your current database
$blog_table_prefix = 'wp_'; //Prefix of your wpmu blog tables, most likely this won't need to be changed
$newdb_prefix = 'jungleprod_'; //This is the prefix of the db's you're moving your tables into - we assume they are all the same, if not, you're in trouble

//We need info to connect to the databases
$dbhost = 'localhost';
$dbuname = 'ks';
$dbpass = 'mypassword';

//How many db's are you moving into (16, 256, or 4096)?
$db_scaling = '256';

I have triple checked the name of my current db and its correct as is the new prefix (also jungleprod_). I wonder what else can produce this error message? I have recently renamed the site network's main db from jungle_ to jungleprod_, could that previous renaming be a problem? Or could it be an access rights issue in phpmyadmin?