2

I have made my first Laravel project and tried to deploy it to the Heroku. It works, but when I tried to login or register it saying "SQLSTATE[HY000] [2002] Connection refused (SQL". There is my site: http://rocky-river-97869.herokuapp.com/login

After login should look like this: Do I have connect PhpMyAdmin separately? Thank you for you help

Darius
  • 268
  • 4
  • 16
  • 1
    Did you make a new .env file with the correct credentials of your production database? Have you ran composer install , php artisan migrate, .. . If you set your debug to true, you can see the actual error (ofc switch it back of afterwards) – Christophvh Nov 07 '17 at 10:58
  • check your .env file and database connection details – Kuldeep Mishra Nov 07 '17 at 10:59
  • Right now it says SQLSTATE[HY000] [2002] Connection refused (SQL. Everything working in localhost, but after deploing stoped – Darius Nov 07 '17 at 11:27

1 Answers1

4

If yours Laravel project use MySQL you HAVE to use Heroku add-ons CLEARDB. In the link shows step by step how to solve the problem. It will be useful for newbie like me. https://mycodexp.wordpress.com/2016/05/19/deploying-laravel-app-to-heroku-using-mysql-database/

Darius
  • 268
  • 4
  • 16