Report this

What is the reason for this report?

"ERROR 2002 (HY000): /tmp/mysql.sock" How to fix it ? Ubuntu 12.04

Posted on May 29, 2015

I try change my password, but show this. how to to fix it ?

*root@TS3:~/serverpug# mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)*

My system is Ubuntu 12.04



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Check that mysql is running with “service mysql status” and if you’re not sure jsut do “service mysql start” and then try again.

Show This:

root@TS3:~/serverpug# service mysql status
mysql stop/waiting
root@TS3:~/serverpug# service mysql start
start: Job failed to start
root@TS3:~/serverpug#

D ;

my sites are down about 12 hours due this problem. mysql server is running. please advise

● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2017-11-21 00:39:38 UTC; 6s ago
  Process: 5085 ExecStartPost=/usr/share/mysql/mysql-systemd-start post (code=exited, status=0/SUCCESS)
  Process: 5076 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 5084 (mysqld)
    Tasks: 13
   Memory: 104.7M
      CPU: 270ms
   CGroup: /system.slice/mysql.service
           └─5084 /usr/sbin/mysqld

Nov 21 00:39:08 ubuntu-1gb-fra1-01 systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Nov 21 00:39:08 ubuntu-1gb-fra1-01 systemd[1]: Stopped MySQL Community Server.
Nov 21 00:39:08 ubuntu-1gb-fra1-01 systemd[1]: Starting MySQL Community Server...
Nov 21 00:39:38 ubuntu-1gb-fra1-01 systemd[1]: Started MySQL Community Server.
root@ubuntu-1gb-fra1-01:/etc/mysql# service mysql status
● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2017-11-21 00:39:38 UTC; 33s ago
  Process: 5085 ExecStartPost=/usr/share/mysql/mysql-systemd-start post (code=exited, status=0/SUCCESS)
  Process: 5076 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 5084 (mysqld)
    Tasks: 13
   Memory: 107.6M
      CPU: 281ms
   CGroup: /system.slice/mysql.service
           └─5084 /usr/sbin/mysqld

Nov 21 00:39:08 ubuntu-1gb-fra1-01 systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Nov 21 00:39:08 ubuntu-1gb-fra1-01 systemd[1]: Stopped MySQL Community Server.
Nov 21 00:39:08 ubuntu-1gb-fra1-01 systemd[1]: Starting MySQL Community Server...
Nov 21 00:39:38 ubuntu-1gb-fra1-01 systemd[1]: Started MySQL Community Server.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.