The port should be 3306 and you should let the hostname to localhost.
Nov 23, 2015
10
Level 9
SQLSTATE[HY000] [2002] Connection refused
I am getting this error
SQLSTATE[HY000] [2002] Connection refused
database.php
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', 33060),
'database' => env('DB_DATABASE', 'homestead'),
'username' => env('DB_USERNAME', 'homestead'),
'password' => env('DB_PASSWORD', 'secret'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
],
.env
APP_ENV=local
APP_DEBUG=true
APP_KEY=J6cc5Vpd1q5F76VGcCfMY3rx8dEeCOfE
DB_HOST=127.0.0.1
DB_PORT=33060
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
Homestead.yaml
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: D:\Project\PHP
to: /home/vagrant/Code
sites:
- map: laravel.dev
to: /home/vagrant/Code/Laravel/public
- map: quickstart.dev
to: /home/vagrant/Code/quickstart/public
databases:
- homestead
variables:
- key: APP_ENV
value: local
- key: DB_PORT
value: 33060
# blackfire:
# - id: foo
# token: bar
# client-id: foo
# client-token: bar
# ports:
# - send: 93000
# to: 9300
# - send: 7777
# to: 777
# protocol: udp
Level 26
2 likes
Please or to participate in this conversation.