-5

When I try to run " php artisan key:generate " I get the following error in promptScreenshot of the error Actually I am running a laravel project on different laptop. I am having this issue while generating a key. How can I solve it?

Error In Connection.php line 647: SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES) (SQL: select * from information_schema.tables where table_schema = homestead and table_name = permissions) In PDOConnection.php line 47: SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES) In PDOConnection.php line 43: SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES)
Everest
  • 23
  • 1
  • 7
  • That is a database connection error. Have you changed anything in app/config/database.php? Does your user have access from the computer you are running artisan? – Daniel Gale Mar 02 '18 at 03:44
  • k bho solta @Everest tyo .env file ma heru parcha dababase connection credentials milayana jasto cha – usrNotFound Mar 02 '18 at 03:45
  • I have not changed anything in app/config/database.php. I am able to run other projects smoothly. But I am trying to run this project 1st time in my computer – Everest Mar 02 '18 at 03:50
  • first of all you will need to have running mysql/database server. Second part check your database credentials and make sure they are correct. – usrNotFound Mar 02 '18 at 03:51
  • Then you should change the app/config/database.php and set the correct credentials for the computer you are running this first time on. – ezw Mar 02 '18 at 03:58
  • @ezw what do you mean by first time? Different system can have different database credentials dont you agree? – usrNotFound Mar 02 '18 at 03:59
  • @usrNotFound That is exactly what I mean. He is running this app 1st time on his computer and is wondering why he is getting that error. According to him, he is running it for the first time on his PC and didn't edit the database config to set up the credentials. I did suggest him change the credentials... what confuses you? – ezw Mar 02 '18 at 04:00
  • It is solved after updating DB_DATABASE, DB_USERNAME, DB_PASSWORD .I thought it could be changed later after generating the key but it was supposed to be changed earlier . Thank you all – Everest Mar 02 '18 at 05:41

1 Answers1

1

Just put Your system's database configuration in .env file. Like Database name user and password.

Ronak Bokaria
  • 616
  • 6
  • 6