Configuring a new Linux installation I was creating a new MySQL database using phpMyAdmin, which I had just installed to allow me to import a database
I tried with directly logging into the database using
mysql -u Username -p
The error was shown as:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Was this going to be an easy fix or prove to be a more time consuming error to research and resolve?
I realised that I was yet to install the MySQL server.
Having rebuilt the computer with a replacement hard drive numerous packages had been installed.
Installing PHPMyAdmin there were errors connecting to MySQL leading to the discovery that I was yet to install MySQL.
I installed MySQL using the command:
apt-get install mysql-server
With MySQL installed PHPMyAdmin worked and all was well. The Can’t connect to MySQL server error was resolved.
A silly error, if you are intending to use a MySQL database don’t forget to install it.


