Danish Kazmi
Danish Kazmi

Reputation: 111

CPanel SQLSTATE[HY000] [1045] Access denied for user

I'm a fresher in Cpanel laravel hosting. I'm facing a specific problem SQLSTATE[HY000] [1045] Access denied for user 'mbaam_trodian'@'localhost' (using password: YES) (SQL: select * from users where email = [email protected] limit 1) and can't found any solution for 3 days.

Localhost: localhost setting

database user:

database user settings

.env file:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=mbaam_smart_hospital
DB_USERNAME=mbaam_trodian
DB_PASSWORD=*************

Upvotes: 4

Views: 4401

Answers (3)

Ravi Katuwal
Ravi Katuwal

Reputation: 1

mine worked after I created new user and assigned to the db.

Upvotes: 0

Rachael
Rachael

Reputation: 41

Try and removed all special characters from database password and replace with only alphabet or alphanumeric. for instance, DB_PASSWORD= mbamTrod0105

Upvotes: 4

tameemahmad shahzad
tameemahmad shahzad

Reputation: 577

  1. make database user in your cpanel
  2. add newly created user into your .env file
  3. clear cache php artisan cache:clear and then php artisan config:cache or you can delete the files into bootstrap/cache folder then your laravel project work fine

Upvotes: 2

Related Questions