Error SQLSTATE [HY000] [1045] cPanel

0

I am currently working on a Laravel project. I did the implementation on a shared server, but I get the error message SQLSTATE [HY000] [1045] Acceso denegado para el usuario 'root' @ 'localhost (usando la contraseña: NO)

The project in Local works correctly for me, but in the server it is limited only to the error. I set the environment variables in my .env file to the corresponding data.

I think the server probably does not read the .env file and that's why the problem arises. Does anyone know what can be done?

I repeat: I changed the data that I had in local by my production data.

Thanks!

    
asked by Brayan Angarita 20.10.2017 в 22:30
source

1 answer

0

If the server does not read the data from the .env file, you should change the necessary data in the file config / database.php

I imagine you are using mysql, so configure the variables that your hosting service provider has given you:

config / database.php

'mysql' => [
        'driver' => 'mysql',
        'host' => env('DB_HOST', 'RUTA_HOST'),
        'port' => env('DB_PORT', '3306'),
        'database' => env('DB_DATABASE', 'NOMBRE_BASE_DE_DATOS'),
        'username' => env('DB_USERNAME', 'USUARIO_BASE_DE_DATOS'),
        'password' => env('DB_PASSWORD', 'CONTRASEÑA_USUARIO_BASE_DE_DATOS'),
        'charset' => 'utf8',
        'collation' => 'utf8_unicode_ci',
        'prefix' => '',
        'strict' => true,
        'engine' => 'InnoDB',
    ],
    
answered by 26.10.2017 в 18:44