Access denied for user ‘homestead’@’localhost laravel 5

问题出在laravel 根目录的.env文件里

APP_ENV=local
APP_DEBUG=true
APP_KEY=your_key

DB_HOST=localhost
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null

1. 修改你自己的数据库

DB_HOST=localhost
DB_DATABASE=laravelu
DB_USERNAME=root
DB_PASSWORD=''

2. 重启apache web服务器

3. 仍然不行,运行如下命令

php artisan config:clear

你可能感兴趣的:(Access denied for user ‘homestead’@’localhost laravel 5)