E
E
expeerd2015-09-30 18:59:28
Laravel
expeerd, 2015-09-30 18:59:28

How to solve ODB laravel error?

Actually the error itself:

PDOException in Connector.php line 50:
SQLSTATE[HY000] [2005] Unknown MySQL server host 'localhost:3306' (2)

Config:
'mysql' => [
            'driver'    => 'mysql',
            'host'      => env('DB_HOST', 'localhost'),
            'database'  => env('DB_DATABASE', 'database'),
            'username'  => env('DB_USERNAME', 'root'),
            'password'  => env('DB_PASSWORD', 'root'),
            'charset'   => 'utf8',
            'collation' => 'utf8_unicode_ci',
            'prefix'    => '',
            'strict'    => false,
        ],

In theory, this means that he cannot reach the host, but what to do in this case?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav Soprun, 2015-10-01
@soprun

  1. Check if .env is correct
    Tip: Don't touch the configs! there is a special .env file !

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question