This is a very complicated and tiring problem that we face. So follow these steps to make it work perfectly:
Steps:
1. open terminal
2. mysql -u root -p (enter)
3. enter your password
4. use mysql;
5. select user, host, plugin from mysql.user;
6. update user set plugin='mysql_native_password' where user='root';
7. update user set Password='Password('my_password') where user='root';
or
update user set authentication_string=password('my_password') where user='root';
8. flush privileges;
7. exit;
8. service mysql restart
The solution above by @ammadasif25 works. Create a new user and give full privileges. I had trouble following the text above. Here is the same solution explained a little differently - it's the one that helped me...
I have this problem and try all those solutions but it doesn't work
SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' (SQL: select * from information_schema.tables where table_schema = blog and table_name = migrations and table_type = 'BASE TABLE')
@Said Omar if none of these solutions work, then your problem most likely isn't the same. Create a new tread and perhaps link to this one, saying nothing here worked for you
am facing same issue like 'Illuminate
\
Database
\
QueryException
PHP 8.2.27
11.21.0
SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost'
select
*
from
sessions
where
id = xINMeXW3DRCYIUv8dLMXwz3L4O8XzLbpgz3uhHNW
limit
1'.. any solutuons?
my .env like
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=admin_
DB_USERNAME=rootdfs5435
DB_PASSWORD=kQ8wd6^27
problem solved, i reinstall laravel using plesk panel (using laravel toolkit provided by plesk), then replace default laravel files with my current files, then clear all type caches, set correct env credentials, all problem solved!!!