1

Running through a Lumen tutorial that was written a year ago and several versions prior to the latest version of Lumen.

I've created an .env file which contains MySQL credentials for my project however when I attempt to run this:

php artisan migrate:install

I'm met with the following error:

Access denied for user 'forge'@'localhost'

So it seems apparent after Googling that it's not picking up my custom .env (i.e. custom.env) file. In the tutorial, it advises to uncomment this:

Dotenv::load(__DIR__.'/../');  

From bootstrap/app.php however that line doesn't exist. There is however a try statement that looks like this:

  try {
      (new Dotenv\Dotenv(__DIR__.'/../'))->load();
  } catch (Dotenv\Exception\InvalidPathException $e) {
      //
  }

but it's uncommented and active. My custom .env is in the project root directory - same location as .env.example - and named custom.env.

What am I doing wrong?

sparecycle
  • 2,038
  • 5
  • 31
  • 58

1 Answers1

2

RTM

It states in Lumen documentation (https://lumen.laravel.com/docs/5.2/configuration#environment-configuration):

"You should rename the .env.example file to .env when creating your application."

I named my custom .env file custom.env. It only needed to be .env.

Ran php artisan migrate:install and the migration table was created successfully.

Community
  • 1
  • 1
sparecycle
  • 2,038
  • 5
  • 31
  • 58