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.

karel
  • 114,770

2 Answers2

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

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.
George Udosen
  • 36,677