Hussein Barada
Hussein Barada

Reputation: 117

I'm using Laravel 5 and I'm not being able to migrate my database using php artisan migrate

I'm using Laravel 5 but I'm not being able to migrate my database table. I have a macbook pro and I'm using Terminal. I'm using php artisan command:
php artisan migrate. When I execute this command, I get the following error message: [PDOException]
SQLSTATE[HY000] [2002] Connection refused.

I have configured my database.php following the official tutorial videos on laracasts.com. My database.php file looks like the following:
...

'fetch' => PDO::FETCH_CLASS,
...
'default' => env('DB_CONNECTION', 'sqlite'),
...
'connections' => [

'sqlite' => [
'driver' => 'sqlite',
'database' => database_path('database.sqlite'),
'prefix' => '',
],
....

I have read many comments on stackoverflow.com about this issue. Most of them are talking about modifying the ".env" file. The thing is I can't find this file! Which makes me wonder if my installation of Laravel is complete or not! I read that my ".env" file might be overriding my "database.php" file but I can't file the ".env" file!

Upvotes: 0

Views: 54

Answers (1)

AshMenhennett
AshMenhennett

Reputation: 1095

The env file is most likely hidden.

  1. Run defaults write com.apple.finder AppleShowAllFiles YES and Killall Finder in Terminal.

  2. Open Finder and you should be able to see the .env file.

  3. Edit your .env file.

Upvotes: 1

Related Questions