用户'root'@'localhost'的访问被拒绝-Laravel [英] Access denied for user 'root'@'localhost' - Laravel
本文介绍了用户'root'@'localhost'的访问被拒绝-Laravel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个带有Laravel 4的应用程序,该应用程序可以在本地主机上正确运行, 但是当我将其上传到主机时,我收到了错误消息.
I have an application with Laravel 4, that runs in localhost correctly, but when I uploaded it in my host I received the error .
app> config> database.php文件为:
app>config>database.php file is:
'mysql' => array(
'driver' => 'mysql',
'host' => '127.0.0.1',
'database' => 'forum',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
),
并且bootstrap> start.php是:
And bootstrap>start.php is:
$env = $app->detectEnvironment(array(
'local' => array('homestead'),
));
推荐答案
这对我有用:
php artisan config:clear
即使我更改了.env
文件中的config
详细信息,也遇到了拒绝访问"错误.运行上面的命令将清除配置缓存文件,因此laravel将从.env
文件中读取新数据.
Even though I changed the config
details in the .env
file, I was getting the Access denied error. Running the above command will clear configuration cache file and hence laravel will read the fresh data from the .env
file.
这篇关于用户'root'@'localhost'的访问被拒绝-Laravel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文