自从我尝试使用 Homestead 作为我的开发环境以来,我对 Laravel 4.2 迁移有一个奇怪的问题。当我这样做时,
php artisan migrate
我收到以下错误:
[PDOException]
SQLSTATE[HY000] [1045] Access denied for user 'prod'@'localhost' (using password: YES)
Laravel 正在使用我的生产环境中的数据库设置,尽管 Laravel 检测到了正确的环境:
$ php artisan env
Current application environment: local
对应的database.php也已经到位:
$ cat app/config/local/database.php
<?php
return array(
[...]
'connections' => array(
'mysql' => array(
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'homestead',
'username' => 'homestead',
'password' => 'secret',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => true,
),
[...]
),
);
有人知道如何找出问题所在吗?