PDA

View Full Version : Ubuntu, MySQL "#2002 Cannot log in to the MySQL server"



Konkor
20th July, 2011, 01:15 PM
I have a website that is hosted off my linux desktop, I use the MySQL for a guestbook and stuff but recently when I try to log in to PHPMyAdmin it says "#2002 Cannot log in to the MySQL server" and everything that uses MySQL says "Cannot Connect to Server" I tried "sudo service mysql reload", tried restarting apache2, restarting my computer even changed "localhost" to "127.0.0.1" in the config.inc.file thing then reloaded everything again, but still nothing works. Does anyone have any ideas or suggestions? I have been googling all morning.

GastonJ
7th September, 2011, 12:09 AM
Is mysqld actually starting and running? Try

/etc/init.d/mysql status

to check on the status and work from there. If it is running try a manual connect, I assume you have the mysql client installed? with:

mysql -u username -p

enter the password and you should be ok. If that all works, then you may need to reconfigure PHPMyadmin. I normally use Webmin rather that PHPMyAdmin out of preference.

HTH