How to see which database Craft is currently connected to?
You could do something like this to at least see which environment from your multi-environment config that Craft is matching:

$craft = require 'path/to/craft/app/bootstrap.php';
echo $craft-&gt;config-&gt;get('server', ConfigFile::Db);