J
J
jazzus2019-02-09 12:21:57
Laravel
jazzus, 2019-02-09 12:21:57

How to fix Access denied for user 'forge'@'localhost' in Forge Laravel?

Engaged in the process of deploying a Laravel+Vue application to production. I don’t understand anything in this matter, so I’m trying different options at random. The first to be poked was Laravel Forge forge.laravel.com. What he does there is a mystery to me. In particular, where Forge takes settings, vendor, database if they are not in git. But it's okay, the questions are not pressing yet. At the moment I installed vps, Forge installed everything that is needed on it (php, etc.). Then I moved on to adding the git repository. Bitbucket download failed with message

Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover

In Connection.php line 664:
                                                                               
  SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using pa  
  ssword: NO) (SQL: select * from `perms`)                                     
                                                                               
In Connector.php line 70:
                                                                               
  SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using pa  
  ssword: NO)                                                                  
                                                                               
Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1

Various options are spinning in my head. But it is not clear what kind of user, where he connects there and where to register access for him. Database Password or what for the user? Forge sent it to me when I registered the server. And where to indicate it? Env update, then upload to git again? Then it will not connect to the local server. Because there is a bd. In general, I got confused from a misunderstanding of the process, I decided to ask the question here, how to do it) I would be grateful for the help

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Arutyunov, 2019-02-09
@jazzus

You have all the settings in the .env file, they specify access to the database. Set the correct settings, then reset the cache

php artisan cache:clear && php artisan config:cache
and then continue.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question