SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES) (SQL: select * from `table`)

前端 未结 2 870
天涯浪人
天涯浪人 2021-01-14 19:05

I am using Laravel, and I have already configured .env file. When I make migration and I migrate, it affects the database, but when I try to read from same database I get th

2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-14 19:53

    You have to set the right permissions:

    $ mysql -u root -p
    $ 
    $ use mysql
    $ GRANT ALL ON *.* to 'homestead'@'localhost' IDENTIFIED BY '';
    $ FLUSH PRIVILEGES;
    

提交回复
热议问题