Laravel 5 database issue

前端 未结 13 833
抹茶落季
抹茶落季 2020-12-15 04:24

I\'ve installed laravel 5 successfully by using this command:

composer create-project laravel/laravel test-laravel-5-project dev-develop --prefer-dist


        
相关标签:
13条回答
  • 2020-12-15 05:12

    for me

    sudo service apache2 reload
    

    did the job

    0 讨论(0)
  • 2020-12-15 05:13

    i have same issui, edit file .env on root folder and change database config DB_DATABASE DB_USERNAME DB_PASSWORD

    0 讨论(0)
  • 2020-12-15 05:17

    I got the same problem. After I use the command "php artisan config:clear" to clear the old configuration cache file, it can work. Maybe you can try it.

    By the way, my English is not good, hope you can understand.

    0 讨论(0)
  • 2020-12-15 05:18

    I had a very similar issue and didn't know where to look. I cleared the cache, restarted server, etc., no joy. Until I found it...

    Before I reverted to a previous version on the Git repo, I used to have my session driver set to use the database! Silly thing, but it's not necessarily the database connection what you need to look at but instead where you are invoking the database to be used at the first place.

    I hope that somebody who'll end up on this page the way I did will find this helpful.

    0 讨论(0)
  • 2020-12-15 05:20

    Laravel is using .env file so change the .env file or change in the database.php file without env()

    'mysql' => [
            'driver'    => 'mysql',
            'host'      => 'localhost',
            'database'  => 'your database name',
            'username'  => 'your database username',
            'password'  => 'your database password',
            'charset'   => 'utf8',
            'collation' => 'utf8_unicode_ci',
            'prefix'    => '',
            'strict'    => false,
        ]
    
    0 讨论(0)
  • 2020-12-15 05:22

    you can restart your server I think is a catch error in Laravel so run your server again with "php artisan serve" and refresh your website page IT's OK.

    0 讨论(0)
提交回复
热议问题