Access denied for user 'root'@'localhost' - Laravel

后端 未结 4 712
天命终不由人
天命终不由人 2021-01-05 00:21

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 file is:

4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-05 00:34

    You must find out the credentials of Database host, Database Name , Database Username and Database Password . (If any prefix for tables too) and then replace it with the current credentials.

    Use the concept of environments and store values in ENV variables :

    http://laravel.com/docs/4.2/configuration

    You can store Env Variables as array in .{ENV_NAME}.env.php and access those variables as $_ENV['variable_name'].

提交回复
热议问题