Error in Mysql installation

Asked

Viewed 653 times

0

After trying to install LAMP package on Ubuntu 16.04, I am getting the error:

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

I have reinstalled 2x all Mysql;

apt remove mysql* and apt- purge mysql*.

I tried to install Mysql 5.6 and 5.7 and both return the same error.

Installed version of PHP:

PHP 7.0.11-1+deb.sury.org~xenial+1 (cli) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies with Zend Opcache v7.0.11-1+deb.sury.org~xenial+1, Copyright (c) 1999-2016, by Zend Technologies

Apache:

PHP 7.0.11-1+deb.sury.org~xenial+1 (cli) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies with Zend Opcache v7.0.11-1+deb.sury.org~xenial+1, Copyright (c) 1999-2016, by Zend Technologies

  • Which command you used to install mysql ?

  • @Douglas, I tried with apt-get install mysql-server (this installs 5.7), and also tried to add the ppa of version 5.6.

  • Right, and how are you trying to access the mysql in which returns this error ?

  • mysql -u root -p

  • Okay, I believe I can help you: http://stackoverflow.com/questions/11990708/error-cant-connect-to-local-mysql-server-through-socket-var-run-mysqld-mysq

  • @Douglas, I had already seen this topic and as Voce can see it is related to the absence of a file, which is not my case...

Show 1 more comment

1 answer

1

I was able to resolve by restarting the pc and installing

sudo apt-get install mysql-client-core-5.7

and then the

sudo apt-get install mysql-server

Browser other questions tagged

You are not signed in. Login or sign up in order to post.