I don't know what the proper defaults are for MAMP. They are certainly different from XAMPP.
By heart everything you used sounds familiar, except the database credentials, I would expect username: root, no password. But please verify in the MAMP documentation.
I have no experience with MAMP but on a Debian server using root to log on the database I get an access denied error - even though I can log in with those credentials on the console using mysql. You could try creating a new database user and setting permissions as Unix based systems are stricter on root access through web based applications.
I have moved past this problem only to get a line 89 page2.php error which again looks like a permission error.