mysql - Php Fatal error: Uncaught PDOException: SQLSTATE[HY000] [1045] Access denied for user 'fobos'@'localhost' (using password: YES)
I have problems with connecting to the Mysql database (v5 and v8). If user is root that it's ok but if I create user 'fobos' I have connection error 1045 (error message PDOException: SQLSTATE[HY000] [1045] Access denied for user 'fobos'@'localhost' (using password: YES) in vms\public\staff\visitors\vms.php on line 14
). I have no idea why this is happening.
Mysql -> create user fobos
SELECT user, host FROM mysql.user
+
php
{-code-3}
Answer
Answer
Answer
Answer
Answer
Answer
Answer
Solution:
try FLUSH PRIVILEGES command in mysql cli
Source