0

i have install mysql in my server {ubuntu 12.04 LTS} and it's work great

but now all my database is down and when i run in termeanl {mysql} it's give this error

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

and when i try to start mysql it's give that error {service mysqld start}

mysqld: unrecognized service

i dont need to lose my data so i dont make anything in the server, can you please help me?

Sideeq Youssef
  • 903
  • 2
  • 10
  • 24
  • There are lots and lots of links for troubleshooting this error. For example: [ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'](http://stackoverflow.com/questions/11657829/error-2002-hy000-cant-connect-to-local-mysql-server-through-socket-var-run) – paulsm4 Dec 17 '13 at 22:47
  • Did you also try to start it through `/etc/init.d/apache`??? – Mathlight Dec 17 '13 at 22:47
  • @paulsm4 it's not same issue – Sideeq Youssef Dec 17 '13 at 22:51
  • @Mathlight it's work now when i run this command /etc/init.d/mysql start – Sideeq Youssef Dec 17 '13 at 22:54
  • @csbukhari, glad i could help. I will post it as an answer so that you can check this question as answerd. – Mathlight Dec 17 '13 at 22:54

2 Answers2

2

As i menthoid here, there are many ways to rome. I did mention apache, but as you figured out, the correct term was mysqld.

So instead of the command start mysql, you can also use /etc/init.d/mysqld start.

Community
  • 1
  • 1
Mathlight
  • 6,436
  • 17
  • 62
  • 107
0

There are lots and lots of links for troubleshooting this error. For example:

In your case "111" is connect error - you simply don't have the mySql server running.

So the real problem is getting "service mysqld start" to work.

Suggestion: try reinstalling:

Community
  • 1
  • 1
paulsm4
  • 114,292
  • 17
  • 138
  • 190
  • Thanks, but it's not the same issue, i try to make it run with service mysqld start.. – Sideeq Youssef Dec 17 '13 at 22:55
  • 1
    It's *exactly* the issue. The "error 2002" is a red herring because the service won't start (I/O error 111: connection refused). The goal is to figure out why it isn't starting. Then make it start automatically. – paulsm4 Dec 17 '13 at 22:57
  • @csbukhari, i must agree with paylsm4. The `/etc/...` thing is just a work around. You've got to find out why it isn't starting normal. ( so you better start reading all the apache log files, mysql log files and system log files and try to see where an error occurs – Mathlight Dec 17 '13 at 22:59