Running console (yiic) under MAMP (Windows)
I may have found my own solution. It looks as if Yiic was not picking up the .env file.

The file ... craft\app\etc\console\yiic .. must therefore be changed from ...

#!/usr/bin/env php
&lt;?php
require_once(dirname(__FILE__).'/yiic.php');


... to ...

#!/usr/bin/env php
&lt;?php
require_once('../../../../vendor/autoload.php');
try {
    $dotenv = new Dotenv\Dotenv('../../../../');
    $dotenv-&gt;load();
    $dotenv-&gt;required(['DB_HOST', 'DB_NAME', 'DB_USER', 'DB_PASS']);
} catch (Exception $e) {
    exit('Could not find a .env file.' . $e);
}
require_once(dirname(__FILE__).'/yiic.php');


Hope this is of use to other people.