Laravel 5 database.php set to sqlite
I seem to be having a problem with artisan reading the default config/database.php file.
When I run for php artisan migrate:status
- or any other migration related commands I get
exception 'PDOException' with message 'SQLSTATE[28000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES)'
even though the default database connection name is set to sqlite
, which doesn't require credentials of any kind.
My .env has APP_ENV=local
and I'm running it under the local environment with PHP 5.6.2 using Mamp.
调用php artisan
我注意到有一个命令来清除配置缓存文件php artisan config:clear
- 然后运行php artisan config:cache
来缓存应用的更改 - 这解决了问题。
上一篇: 设置数据库用户名和密码时发生PDO异常