First, you need to define, what is 'local' environment
$env = $app->detectEnvironment(array( // everything that contains 'localhost' or '127.0.0.1' // in URL will be considered to run in local env. 'local' => array('localhost', '127.0.0.1'), ));
Then, you need to create directory named local in app/config. If you want to override DB settings in local env. create the file: app/config/local/database.php and override setting in this file, for example:
'connections' => array( 'mysql' => array( 'username' => 'otherUserName', 'password' => 'otherPassword', ), ),
In this file, you do not need to specify all options, only options that are different from production/base configuration.
More info in official docs