I just upgraded kali linux and mysql has been broken ever since. after I start mysql & apache2 services I run the command mysql then I get this error:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I check to see if I have mysql-server installed, So I run apt-get install mysql-server-5.5

and this is what I get:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package mysql-server-5.5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  mariadb-server-10.1:i386 mysql-common mariadb-server-10.1

E: Package 'mysql-server-5.5' has no installation candidate
  • Did you run "sudo apt-get install mysql-server-5.5" or just "apt-get install mysql-server-5.5" ? – Leo Chapiro Feb 13 '18 at 9:48
  • @duDE Yeah tried that. Still the same message. – muhzi Feb 13 '18 at 9:50
  • So your problem is not "Can't connect to local MySQL" but "Can't install MySQL" ? – Leo Chapiro Feb 13 '18 at 9:58
  • @duDE it was running perfectly fine before I upgrade my kali. So I'm not exactly sure what the problem is. – muhzi Feb 13 '18 at 10:03
  • Have you tried to re-install MySQL (sudo apt-get purge)? Take a look: askubuntu.com/questions/172514/how-do-i-uninstall-mysql – Leo Chapiro Feb 13 '18 at 10:17

I face the similar error. It's because mysql-server is not installed. But in latest Kali installation the MariaDB for is used instead of MySQL. You can install the server using,

apt install mariadb-server

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.