My env file as follow:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=admin_clrank
DB_USERNAME=admin_clranke
DB_PASSWORD=admin@123
i am getting the error and i have checked the username and password that are same.My website is in cpanel. config.php file is also delted.
7
Answers
Steps to debug:
Use console and artisan:
This will clear cache configuration and then new settings will work.
Try to use username and password as follows with quotation. i have no idea how it worked, but it really worked for me after searching a lot.
it can be fixed by adding a ‘ single quote on database user and password
like this. it will work fine for me
1- Add single quote ‘ in username and password
2- Then add this route in your web app and open it from browser:
create and grant access to user homeimpr_clranke
make sure your database name is also correct and take note your cpanel username is attached to the db_database
change DB_HOST to localhost
and run php artisan cache:clear
and php artisan config:cache