SQLSTATE [28000] [1045]用户'homestead'@'localhost'的访问被拒绝(使用密码:是)

问题描述:

我在使用Laravel 5.2的Ubuntu 15.10 Yosemite.*

I'm on a Ubuntu 15.10 Yosemite using Laravel 5.2.*

这是我的.env文件:

Here is my .env file:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=Pastry
DB_USERNAME=root
DB_PASSWORD=243320

app \ config \ database.php

app\config\database.php

    'mysql' => [
        'driver' => 'mysql',
        'host' => env('DB_HOST', 'localhost'),
        'port' => env('DB_PORT', '3306'),
        'database' => env('DB_DATABASE', 'Pastry'),
        'username' => env('DB_USERNAME', 'root'),
        'password' => env('DB_PASSWORD', '243320'),
        'charset' => 'utf8',
        'collation' => 'utf8_unicode_ci',
        'prefix' => '',
        'strict' => false,
        'engine' => null,
    ],

当我收到消息时,成员:

emember when I got the message:

SQLSTATE [28000] [1045]用户'homestead'@'localhost'的访问被拒绝(使用密码:是)

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

请帮助我!

感谢您的指导. 我无权访问数据库. 但是,迁移的建设工作正常进行. 但是我不能运行它进行测试运行:

Thank you for your guidance. I do not have access to the database. But the construction of migrations was run properly. But I can not run it for a test run:

    public function index()
{
    $com = new Categorys();
    $com->name          = 'ali';
    $com->ename       = 'hi';
    $com->img            = 'sdjf';
    $com->save();

   // return View('category.index');
}