mysql Access denied for user ‘root’@’localhost’ on mac


My MAMP is running, still when trying to connect MySQL db into my laravel project.

After PHP artisan serve, browsing application on generated URL. It’s showing mysql Access denied for user ‘root’@’localhost’

How to fix this…

Asked on July 8, 2020 in Mac OS.
Add Comment
1 Answer(s)
Best answer

On mac or unix you have to include the socket path in the configuration database.php file

i.e 'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock',

Answered on July 8, 2020.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.