skip to Main Content

I am new at plesk cpanel. I have tried to configure a laravel project on plesk for at least 5 hours. But It has showed the below error :

SQLSTATE[HY000] [1045] Access denied for user 'database_root'@'localhost' 
(using password: YES) (SQL: select * from `websites` limit 1)

I have searched on google and followed may articles . But can not fixed the errors. Please help me how to fix it.

.env file contains

DB_DATABASE=blog
DB_USERNAME=database_root
DB_PASSWORD=123456abc

2

Answers


  1. Check Database Credentials in cPanel

    So next you need to reset your username and password. In cPanel, click on MySQL Databases under the Databases section.

    DB_CONNECTION=mysql
    DB_HOST=127.0.0.1
    DB_PORT=3306
    DB_DATABASE=database name
    DB_USERNAME=user name
    DB_PASSWORD=your password
    
    Login or Signup to reply.
  2. I think .env change doesn’t appeared to that please clear your cache Make a route

    Route::get('/clear', function() {
    
       Artisan::call('config:clear');
       Artisan::call('cache:clear'); 
       Artisan::call('view:clear');
    
       return "Cleared!";
    
    });
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search