try clear the cache, or simply deletes bootstrap/cache/config.php file.. restart your web service...
php artisan config:clear
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I created a ubuntu server for laravel . I have a root user , that I added in .env file -
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=mywebsite
DB_USERNAME=root
DB_PASSWORD=mypassword
then I migrated the database with the command -
php artisan migrate
It migrated ok . BUT , it is givving this error -
Illuminate\Database\QueryException
SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' (SQL: select `id`, `title`from `posts` order by `id` asc)
It is saying that I dont have permission with my user root , to select . BUT I had permission to migrate . how could I give permission to it ?
Thanks
Please or to participate in this conversation.