The password is definitely correct, yet you get ERROR 1045 (28000): Access denied for user ... . A very common reason: the user was created as 'app_user'@'localhost' , but you're connecting over TCP with -h 127.0.0.1 .
I reproduced it on MySQL 8.4.13 in a container and ran the check and the fix. Every output below is exactly what the mysql client printed.
Reproduce
As root, create a user that only exists for localhost :
CREATE DATABASE shop ; CREATE USER 'app_user' @ 'localhost' IDENTIFIED BY 'App_Pw_2026' ; GRANT ALL ON shop . * TO 'app_user' @ 'localhost' ;
Enter fullscreen mode
Exit fullscreen mode
Connect with the correct password and an explicit host:
$ mysql -h 127.0.0.1 -u app_user -p 'App_Pw_2026' shop
Enter fullscreen mode
Exit fullscreen mode
ERROR 1045 (28000): Access denied for user 'app_user'@'127.0.0.1' (using password: YES)
Enter fullscreen mode
Exit fullscreen mode
Look at 'app_user'@'127.0.0.1' . The server sees the client as 127.0.0.1 , not localhost .…