0

I have upload my laravel project to Ubuntu 14 i have install MySQL to the server put a try to run migrations using php artisan migrate i keep getting this error [PDOException] SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using pas sword: YES i dont understand how to fix this.

  • Check your password on mysql try signing in with the password you know. If it fails then that's your problem, else check your laravel .env file to make sure you have the right password entered there. – George Udosen Dec 16 '16 at 12:06
  • the MySQL lets my in so the password good but the php migration wont work for me – Ray Brown-amory Dec 16 '16 at 12:20
  • check the password in the .env file in laravel – George Udosen Dec 16 '16 at 12:21
  • Have you checked the password yet ? – George Udosen Dec 16 '16 at 13:20
  • Yes i have George and still nothing – Ray Brown-amory Dec 16 '16 at 13:25
0

Hi everyone thanks for the advice and help it was because i did not generate the .en file on the server and my password was wrong to so i am happy now

| improve this answer | |
0

According to your issue you uploaded the entire project including the .env file. In Laravel when uploading your finished work they are several things you don't do:

  1. never upload the .env file instead regenerate a new one using composer update, as this will contain sensitive information that should not moved in that way.
  2. use the same application key for both location, this will be regenerated when composer update is run at the new location.

Solution:

  1. add the .env file to the .gitignore file so it's never seen like other files.
  2. after uploading your work use the included .env.example file, change it to .env then run composer update. Add your database information from the new location there.
  3. run composer update and the new .env file should be ok.
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.