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

后端 未结 4 766
天命终不由人
天命终不由人 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:39

    Maybe you should add double-quotes for password in env:

    # Config: database
    DB_CONNECTION=mysql
    DB_HOST=127.0.0.1
    DB_PORT=3306
    DB_DATABASE=db_name
    DB_USERNAME=db_user
    DB_PASSWORD="db_password"
    

    and

    php artisan config:clear
    

提交回复
热议问题