samedi 25 mai 2019

Unable to use any user in laravel project other than the root

I am a beginner developing an app in Laravel framework. I am facing a problem that only the root user works with my database without the password or the user ''@'host' works. However, when I deploy the app to the server I can not use any of these users

I get the following error, it seems that the Laravel is not reading any user name from .env or database.php file. (as the name of the user is blank here).

SQLSTATE[HY000] [1044] Access denied for user ''@'localhost' to database 'itax'

Again it works if I use the user=root and no password or user=''

Here are the configurations of my .env file

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=itax
DB_USERNAME=raees
DB_PASSWORD=12345

and database.php file

'mysql' => [
        'driver'    => 'mysql',
        'host'      => 'localhost',
        'database'  => 'itax',
        'username'  => 'raees',
        'password'  => '',
        'charset'   => 'utf8',
        'collation' => 'utf8_unicode_ci',
        'prefix'    => '',
        'strict'    => false,
    ],

Anyone facing the same issue or found any solutions to these problems please share



from Newest questions tagged laravel-5 - Stack Overflow http://bit.ly/2Wn5Xwh
via IFTTT

Aucun commentaire:

Enregistrer un commentaire