I was developing a website locally on WordPress without any problems until today, when I got an error from MySQL stating, “Error establishing a database connection.” Then, I checked the phpMyAdmin console, and it showed, “phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username, and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.”
I browsed similar answers here on Stack Overflow but only found answers that required typing in the correct credentials; my problem is that I haven’t tampered with any config files in PHP to get this error, and I was accessing it fine before. I only used WordPress to store data in the database, which I did not do before, but I doubt this could be an issue.
The error by WordPress SS:
WordPress Error
The error by phpMyAdmin SS:
phpMyAdmin Error
I checked other Q&As similar to this one, such as entering the correct credentials and changing the config file to 127.0.0.1, but these both did not work.