Console core:archive fails

on my local mamp pro (4.1.1) installation

core:archive [–url="…"] [–force-all-websites] [–force-all-periods[="…"]] [–force-timeout-for-periods[="…"]] [–skip-idsites[="…"]] [–skip-all-segments] [–force-idsites[="…"]] [–force-periods[="…"]] [–force-date-last-n="…"] [–force-date-range[="…"]] [–force-idsegments="…"] [–concurrent-requests-per-website[="…"]] [–disable-scheduled-tasks] [–accept-invalid-ssl-certificate] [–php-cli-options[="…"]]

fails with the following errors

[Zend_Db_Adapter_Exception]
SQLSTATE[HY000] [2002] No such file or directory

[PDOException]
SQLSTATE[HY000] [2002] No such file or directory

what can i do?

Can you check if the socket you specified for MySQL exists?
https://piwik.org/faq/how-to-install/faq_151/

Thank you!

Adding
unix_socket = "/Applications/MAMP/tmp/mysql/mysql.sock"
to the config.ini.php fixed it.