Today We are Going To Solve SQLSTATE[HY000] [1045] Access denied for user ‘username’@’localhost’ (using password: YES) in Php. Here we will Discuss All Possible Solutions and How this error Occurs So let’s get started with this Article.
Contents
How to Fix SQLSTATE[HY000] [1045] Access denied for user ‘username’@’localhost’ (using password: YES) Error?
- How to Fix SQLSTATE[HY000] [1045] Access denied for user 'username'@'localhost' (using password: YES) Error?
To Fix SQLSTATE[HY000] [1045] Access denied for user 'username'@'localhost' (using password: YES) Error just Set the socket. Here you have to just set the socket:
unix_socket: /Applications/MAMP/tmp/mysql/mysql.sock - SQLSTATE[HY000] [1045] Access denied for user 'username'@'localhost' (using password: YES)
To Fix SQLSTATE[HY000] [1045] Access denied for user 'username'@'localhost' (using password: YES) Error just Change 'localhost' to '127.0.0.1'. Just change 'localhost' to '127.0.0.1' and solve the error.
Solution 1 : Set the socket
Here you have to just set the socket:
unix_socket: /Applications/MAMP/tmp/mysql/mysql.sock
Solution 2 : Change ‘localhost’ to ‘127.0.0.1’
Just change ‘localhost’ to ‘127.0.0.1’ and solve the error.
Conclusion
So these were all possible solutions to this error. I hope your error has been solved by this article. In the comments, tell us which solution worked? If you liked our article, please share it on your social media and comment on your suggestions. Thank you.
Also Read These Solutions
- JSON parse error: Cannot deserialize value of type `java.time.LocalDateTime` from String
- Cannot open local file – Chrome: Not allowed to load local resource
- OpenCV(4.1.2) error: (-215:Assertion failed) !ssize.empty() in function ‘cv::resize’
- OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
- ESLint: Component definition is missing displayName (react/display-name)