Laravel project uploaded from local to cloud server cache update problem
phpcn_u1582
phpcn_u1582 2017-05-16 16:49:17
0
2
477

When developing on local windows, the database name in the .env file is called test. I ftp the entire project folder to the server (centos7), and the database name in the env file is changed to laravel.
Then execute php artisan migrate, but the following error occurs, saying that the test database cannot be found:

  [PDOException]                                  
  SQLSTATE[HY000] [1049] Unknown database 'test'

There is no test database in the first place, where does it come from?
Is this a cache issue? How should I do it?

This isdatabase.php:

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

edit:

This is the .env file of the cloud host:

    APP_ENV=production
    APP_KEY=base64:fzg/000000000000000001qfE0=
    APP_DEBUG=false
    APP_LOG_LEVEL=debug
    APP_URL=http://localhost
    
    DB_CONNECTION=mysql
    DB_HOST=127.0.0.1
    DB_PORT=3306
    DB_DATABASE=laravel
    DB_USERNAME=root
    DB_PASSWORD=

This is the .env file on the local machine:

    APP_ENV=local
    APP_KEY=base64:fzg/000000000000000001qfE0=
    APP_DEBUG=true
    APP_LOG_LEVEL=debug
    APP_URL=http://localhost
    
    DB_CONNECTION=mysql
    DB_HOST=127.0.0.1
    DB_PORT=3306
    DB_DATABASE=test
    DB_USERNAME=root
    DB_PASSWORD=
phpcn_u1582
phpcn_u1582

reply all(2)
左手右手慢动作

php artisan cache:clear

过去多啦不再A梦

composer dumpautoload 试试
datebase.php 是 'default' => 'mysql', ?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template