Another solution is to add the port number in the host key. In this case MAMP uses the 8889 by default:
'mysql' => array(
'driver' => 'mysql',
'host' => 'localhost:8889',
'database' => 'essays',
'username' => 'root',
'password' => 'root',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
),