0

I had a mysql connection problem on ubuntu. I was not able to start mysql service.

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

I tried to fix this error by these commands:

mkdir /var/run/mysqld/
chown mysqld /var/run/mysqld/

After this I can't see my databases in mysql.

What is the problem? What those commands affected to on databases? Or this is about configuration problem?

Can you help me please?

Thanks

tcetin
  • 979
  • 1
  • 21
  • 48
  • Does `mysqld.sock` exist in the directory? – Nasir Riley May 23 '21 at 17:54
  • Have you tried all solutions listed [here](https://stackoverflow.com/questions/11657829/error-2002-hy000-cant-connect-to-local-mysql-server-through-socket-var-run)? – Lucas Mendonca May 23 '21 at 17:56
  • I tried. But I didnt install mysql again with "sudo apt-get install mysql-server" command since it will delete databases. – tcetin May 23 '21 at 18:01
  • @NasirRiley No it doesnt exist. Is this creating by mysql server? Does it need to create manually? – tcetin May 23 '21 at 18:02

0 Answers0