0

How would I go about doing this (the title is the question), I've changed all my ENV files to my hosted mysql details. When i run php artisan migrate from composer I get the

"denied username@localhost using password yes error".

I've changed the port and everything but I'm not sure what to do anymore and I'm 99% sure that the details are correct I've tried them multiple times

George G
  • 7,443
  • 12
  • 45
  • 59
Kenziiee Flavius
  • 1,918
  • 4
  • 25
  • 57
  • Are your files local and do you want them to connect to a remote database? If then, does your remote database have a remote access enabled config? – Taha Paksu Jul 29 '16 at 12:56
  • did you change your database.php details? – Pardeep Pathania Jul 29 '16 at 12:57
  • My files are corrently local do i need to upload them to the server first before running migrate..? please tell me its that simple – Kenziiee Flavius Jul 29 '16 at 12:57
  • @PardeepPathania you dont need to as long as the ENV files are changed it uses the ENV files over the other values in database.php – Kenziiee Flavius Jul 29 '16 at 12:58
  • @KenziieeFlavius i know that but you have to change the details as well, so try to change it. – Pardeep Pathania Jul 29 '16 at 12:59
  • you haven't changed the config of the database, if so, go to your project file then "app/config/database.php" then just change the database name to yours name. (in mysql array) and after that run command php artisan config:clear – Pardeep Pathania Jul 29 '16 at 13:03
  • @PardeepPathania yes this didnt work for me I needed to upload the files and then i could just so 'php artisan migrate' through SSH – Kenziiee Flavius Jul 29 '16 at 14:26

1 Answers1

1

You need check somethings:

  • are credentials valid (username, password and host)?
  • the database host is accessible by your application server?
  • .env file is correctly configured or have some config hard coded in app/config/database.php?

To validade connection, you can try this: http://www.w3schools.com/php/php_mysql_connect.asp

About configuration and enviroments : https://laravel.com/docs/5.2/configuration

Sergio Rodrigues
  • 964
  • 9
  • 12
  • Thank you for this i love how detailed the answers are people give on this site keep up the good work! I figured out the answer to my question though – Kenziiee Flavius Jul 29 '16 at 14:27