Access denied for user 'homestead'@'localhost' (using password: YES)

前端 未结 29 1828
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-27 10:23

I\'m on a Mac OS Yosemite using Laravel 5.0.

While in my local environment, I run php artisan migrate I keep getting :

29条回答
  •  情书的邮戳
    2020-11-27 10:46

    Check MySQL UNIX Socket

    Find unix_socket location using MySQL

    mysql -u homestead -p

    mysql> show variables like '%sock%';
    +-----------------------------------------+-----------------------------+
    | Variable_name                           | Value                       |
    +-----------------------------------------+-----------------------------+
    | performance_schema_max_socket_classes   | 10                          |
    | performance_schema_max_socket_instances | 322                         |
    | socket                                  | /var/run/mysqld/mysqld.sock |
    +-----------------------------------------+-----------------------------+
    3 rows in set (0.00 sec)
    

    Then I go to config/database.php

    I update this line : 'unix_socket' => '/tmp/mysql.sock',

    to : 'unix_socket' => '/var/run/mysqld/mysqld.sock',

    That's it. It works for my as my 4th try.I hope these steps help someone. :D

提交回复
热议问题