Multisite installation on mamp not working

I am trying to change my single site to multi site in a local environment using mamp. Every time I add the define('WP_ALLOW_MULTISITE', true); in wp-config and try to load the localhost, I get an error saying Database cannot be reached or something along those lines. I am stuck!!! Any ideas please...