SQLSTATE HY000 2002 while running bake command

前端 未结 6 1855
不思量自难忘°
不思量自难忘° 2021-02-02 02:48

I have problem running the bake commands. i think it is related to mysql but i didn\'t find any solution to this error on Stackoverflow. This is my app.php:

6条回答
  •  孤独总比滥情好
    2021-02-02 02:58

    I am a beginner and got this problem on CakePHP Tutorial with using MAMP on MAC.

    First I found php in my MAMP with this command:

    find /Applications/mampstack-7.1.21-0/ -type f -name php
    

    This should output your directory…. In my case this was:
    /Applications/mampstack-7.1.21-0//php/bin/php

    Then I found .bash_profile and opened it with this command:

    touch ~/.bash_profile; open ~/.bash_profile
    

    It will open it with TextEdit. Then in this file, I edited path to the one I got with the first command and deleted the extra path with sbin:

    export PATH="/Applications/mampstack-7.1.21-0/php/bin/:$PATH"
    

    In Terminal command:

    grep php ~/.bash_profile
    

    Then I closed all terminals and after that, it works for me.

    Thanks a lot for the first comment, it was helpful to get to this solution.

提交回复
热议问题