Thanks very much! clarkwinkelmann
Thanks everyone!
clarkwinkelmann Or maybe you have a different PHP version on the web and command line and one version has an issue with the sending of credentials?
Just to make a note. Since my php version is 7.4, I did the following:
brew install php@7.4
Set required PHP to you PATH
Once you have installed PHP successfully, now you need to set the required PHP to your PATH. Run the following commands.
echo export PATH="//Applications/MAMP/bin/php/php7.4.12/bin/:$PATH">> ~/.bash_profile
echo export PATH="//Applications/MAMP/bin/php/php7.4.12/sbin/:$PATH">> ~/.bash_profile
source ~/.bash_profile
Which helped me to get the same version for my command line and also in MAMP.
Then the same error messages shows up again. It is resolved this by
Firstly, in terminal
CREATE USER 'username' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'username'@'password';
Secondly, in the config.php
> array (
> 'driver' => 'mysql',
> 'host' => '127.0.0.1',
> 'port' => 8889, (my MAMP phpadmin's port is 8889 instead of 3306)
Not sure if this make sense to anyone, just want to make a note in case someone face the same situation.