XF 2.1 Error when trying to create an addon

In MAMP PRO, after you set host to 127.0.0.1 and if still not working, then you have to enable the Allow network access to MySQL on MAMP PRO MySQL options
 
For anyone else still experiencing this error, make sure you also set your port:

Step 1:
If your src/config.php file contains:
PHP:
$config['db']['host'] = 'localhost';

Then change it to the following which will make it use TCP/IP rather than socket connection:
PHP:
$config['db']['host'] = '127.0.0.1';

Step 2:
PHP:
$config['db']['port'] = '8889';

The default in my version of MAMP PRO is port 8889, but double check if yours is correct in the MySQL section of MAMP.

Step 3: - follow the step from kimchuy
In MAMP PRO, after you set host to 127.0.0.1 and if still not working, then you have to enable the Allow network access to MySQL on MAMP PRO MySQL options

Setting this option to be "only from this Mac" is sufficient.
 
Top Bottom