Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel Cpanel error :SQLSTATE[HY000] [1045] Access denied for user 'homeimpr_clranke'@'localhost' (using password: YES)

Tags:

laravel

cpanel

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.

like image 456
ravneet Avatar asked Nov 20 '17 08:11

ravneet


3 Answers

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.

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=admin_clrank
DB_USERNAME='admin_clranke'
DB_PASSWORD='admin@123'
like image 192
Vishwa Avatar answered Oct 31 '22 03:10

Vishwa


Use console and artisan:

php artisan config:cache

This will clear cache configuration and then new settings will work.

like image 2
Adam Kozlowski Avatar answered Oct 31 '22 04:10

Adam Kozlowski


it can be fixed by adding a ' single quote on database user and password

DB_DATABASE=admin_clrank
DB_USERNAME='admin_clranke'
DB_PASSWORD='admin@123'

like this. it will work fine for me

like image 2
Ajith jojo Avatar answered Oct 31 '22 05:10

Ajith jojo