1

I'm new to Ubuntu. I have xampp installed on Ubuntu and works just fine. But when I am trying to run mysql -u username -p pass from terminal I recieve this error:

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

I've tried to install mysql-server again but it runs completely separate (has another database....and is not working with phpmyadmin from xampp).

How can I make it work in terminal from xampp server?

ana.coman93
  • 235
  • 3
  • 14
  • Possible duplicate of [ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)](https://stackoverflow.com/questions/11657829/error-2002-hy000-cant-connect-to-local-mysql-server-through-socket-var-run) – Aedvald Tseh Jul 21 '17 at 05:38

1 Answers1

0

Your mysql-database might not be running at all!

Try this: sudo /etc/init.d/mysql start then mysql -u yourusername -p yourpasswrd

Aedvald Tseh
  • 1,757
  • 16
  • 31