walid mahmoud
Published in : 2022-02-23

Laravel install passport have access denied error

Laravel

 I tried to install a passport package to my project 

 Illuminate\Database\QueryException : SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' (SQL: insert into `oauth_clients` (`user_id`, `name`, `secret`, `provider`, `redirect`, `personal_access_client`, `password_client`, `revoked`, `updated_at`, `created_at`) values (?, Laravel Starter Personal Access Client, qQ12R2oPeJ2Mrlp0sz4kxW1oVyYHklYp9fwPaUAw, ?, //localhost, 1, 0, 0, 2022-02-23 10:33:52, 2022-02-23 10:33:52)) at /home/walid/work/training/laravel-adminpanel/vendor/laravel/framework/src/Illuminate/Database/Connection.php:669 665| // If an exception occurs when attempting to run a query, we'll format the error 666| // message to include the bindings with SQL, which will make this exception a 667| // lot more helpful to the developer instead of just the database's errors. 668| catch (Exception $e) { > 669| throw new QueryException( 670| $query, $this->prepareBindings($bindings), $e 671| ); 672| } 673| Exception trace: 1 Doctrine\DBAL\Driver\PDOException::("SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost'") /home/walid/work/training/laravel-adminpanel/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:31 2 PDOException::("SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost'") /home/walid/work/training/laravel-adminpanel/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:27 Please use the argument -v to see more details.

how can I solve this issue?

Comments

Yasen Sayed Date : 2022-02-23

Best answers

8

Best answers

8

Please try these approaches.

Set the database info in your env file like this.

DB_USERNAME=rootDB_PASSWORD=

Clear your project cache with these commands.

php artisan config:cachephp artisan config:clearphp artisan cache:clear

walid mahmoud Date : 2022-02-23

Thanks 
It's not worked for me.

 

Yasen Sayed Date : 2022-02-23

Maybe you have a problem with your environment.

Please check the MYSQL service is working or not.

walid mahmoud Date : 2022-02-23

MySQL service is working

Leave a comment

Join us

Join our community and get the chance to solve your code issues & share your opinion with us

Sign up Now

Related posts

Laravel redirect to the last location after login
Publish date: 2022-02-21 | Comments: 1
Laravel API POST method returns 419
Publish date: 2022-08-03 | Comments: 1