walid mahmoud
Published in : 2022-02-23

Laravel install passport have access denied error


 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?


Yasen Sayed Date : 2022-02-23

Best answers


Best answers


Please try these approaches.

Set the database info in your env file like this.


Clear your project cache with these commands.

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

walid mahmoud Date : 2022-02-23

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 error 419 page expired
Publish date: 2021-04-10 | Comments: 2
How to pass valiables to 404 error page in laravel?
Publish date: 2022-02-21 | Comments: 2