duannaikuang1301
2018-10-27 15:05 阅读 41
已采纳

核心UI - Laravel - >设置

I'm trying to make Core UI - Laravel work on my localhost (https://github.com/taboritis/coreui-laravel).

I have followed the steps. I can get to the login screen. I have created the John Doe user by running php artisan migrate:fresh --seed, and I also made the migrations.

I've tried to log in, but every time, I get this error:

SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES) (SQL: select * from users where email = john.doe@example.com limit 1)

My .env file looks like this:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=coreui
DB_USERNAME=root
DB_PASSWORD=root

My config/database.php file looks like this:

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

I'm kind of stuck here. What should I do next?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

2条回答 默认 最新

  • 已采纳
    duanfang5849 duanfang5849 2018-10-27 16:46

    Solved: For some reason I had to restart the web server and after several php artisan config:clear finally worked. Thanks everyone for your comments. You are all upvoted.

    Happy coding!

    点赞 评论 复制链接分享
  • duai5344 duai5344 2018-10-27 15:27

    The password is 321ewq , as you can see in

    coreui-laravel/database/seeds/UsersTableSeeder.php 
    

    GitHub link of the user seeder

    Edit

    The documentation suggests you to put this configuration in your .env file

    DB_CONNECTION=mysql
    DB_HOST=127.0.0.1
    DB_PORT=3306
    DB_DATABASE=coreui
    DB_USERNAME=root
    DB_PASSWORD=
    

    But your .env file looks like:

    DB_CONNECTION=mysql
    DB_HOST=127.0.0.1
    DB_PORT=3306
    DB_DATABASE=coreui
    DB_USERNAME=root
    DB_PASSWORD=root
    

    Restart a web server and run this command:

    php artisan config:clear 
    
    点赞 评论 复制链接分享

相关推荐