php artisan migrate,访问被拒绝

时间:2017-02-11 13:56:13

标签: migrate

迁移时出现这些错误

[Illuminate\Database\QueryException]
SQLSTATE[HY000] [1045] Access denied for user ''@'localhost' (using password: YES) (SQL: select * from information_
schema.tables where table_schema = computersale and table_name = migrations)

[PDOException]
SQLSTATE[HY000] [1045] Access denied for user ''@'localhost' (using password: YES)

我的配置:

    'mysql' => [
        'driver' => 'mysql',
        'host' => env('DB_HOST', 'localhost'),
        'port' => env('DB_PORT', '3306'),
        'database' => env('DB_DATABASE', 'computersale'),
        'username' => env('DB_USERNAME', ''),
        'password' => env('DB_PASSWORD', 'root'),
        'charset' => 'utf8mb4',
        'collation' => 'utf8mb4_unicode_ci',
        'prefix' => '',
        'strict' => true,
        'engine' => null,
    ],

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=computersale
DB_USERNAME=
DB_PASSWORD=root

我尝试清除缓存 config 但是没有用。

0 个答案:

没有答案