I found the solution:
PHP script fix: Originally, I had my test_connect0.php script in /Library/WebServer/Documents. It turns out, it needs to be in /Applications/MAMP/htdocs. Once I moved the file to that location, I entered this url into the browser: localhost:8888/test_connect0.php
That resulted in a successful connection to MAMP's MySQL.
Tableau notes: As I noted earlier, I was able to connect Tableau to MySQL, however, it wasn't connecting to MAMP's MySQL. To shift Tableau to see MAMP's MySQL, I entered the following into Tableau's dialog:
Server: localhost Port: 8888 Username: root Password: ******
Two things are necessary ahead of time:
- Install the OBDC drivers per Tableau's instructions
- Run this in a terminal window: sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock