You are not logged in.

#1 2015-08-02 20:09:33

кто-то
Member
Registered: 2015-07-31
Posts: 8

MySQL returns "2002: No such file or directory"

someone% mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2 "No such file or directory")

When this happened before, I just upgraded mysql and it worked. Now it doesn't, even after upgrading.
What can I do?

Offline

#2 2015-08-02 22:36:36

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: MySQL returns "2002: No such file or directory"

Have you done any form of basic debugging here?
Is MySQL running?
Does that socket exist?
Can you find that socket somewhere else?

Offline

#3 2015-08-11 02:58:26

кто-то
Member
Registered: 2015-07-31
Posts: 8

Re: MySQL returns "2002: No such file or directory"

fukawi2 wrote:

Have you done any form of basic debugging here?
Is MySQL running?
Does that socket exist?
Can you find that socket somewhere else?

MySQL isn't running, the socket doesn't exist in the folder and I can't find it anywhere else. I tried the following:

find / -name mysqld.sock
ps aux | grep mysql

Last edited by кто-то (2015-08-11 02:59:29)

Offline

#4 2015-08-11 03:20:24

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: MySQL returns "2002: No such file or directory"

кто-то wrote:

MySQL isn't running

You don't see this as a problem...?

Offline

#5 2015-08-11 10:48:25

кто-то
Member
Registered: 2015-07-31
Posts: 8

Re: MySQL returns "2002: No such file or directory"

fukawi2 wrote:
кто-то wrote:

MySQL isn't running

You don't see this as a problem...?

I don't get what you are trying to say. When I try to start mysql it returns 2002, so how am I supposed to run it?

Offline

#6 2015-08-11 10:51:43

ayekat
Member
Registered: 2011-01-17
Posts: 1,592

Re: MySQL returns "2002: No such file or directory"

кто-то wrote:

When I try to start mysql it returns 2002, so how am I supposed to run it?

You are launching the MySQL client, which is supposed to connect to a MySQL server, which is not running (but should be, hence the error).


pkgshackscfgblag

Offline

#7 2015-08-11 10:56:54

кто-то
Member
Registered: 2015-07-31
Posts: 8

Re: MySQL returns "2002: No such file or directory"

ayekat wrote:
кто-то wrote:

When I try to start mysql it returns 2002, so how am I supposed to run it?

You are launching the MySQL client, which is supposed to connect to a MySQL server, which is not running (but should be, hence the error).

I see. How can I run the server on initialization?

Offline

#8 2015-08-11 11:01:56

ayekat
Member
Registered: 2011-01-17
Posts: 1,592

Re: MySQL returns "2002: No such file or directory"

What do you mean with initialization? Upon launching the client? Or at boot up?

Latter would be done by enabling the appropriate service file, whereas the first one involves a little more tinkering (mainly detecting when you launch the mysql client, check if the server is running, and if no, initialise it - also keep the client from crashing during the server startup, although I don't personally know what's its timeout).

Have you read the MySQL wiki?


pkgshackscfgblag

Offline

#9 2015-08-11 11:03:42

кто-то
Member
Registered: 2015-07-31
Posts: 8

Re: MySQL returns "2002: No such file or directory"

ayekat wrote:

What do you mean with initialization? Upon launching the client? Or at boot up?

Latter would be done by enabling the appropriate service file, whereas the first one involves a little more tinkering (mainly detecting when you launch the mysql client, check if the server is running, and if no, initialise it - also keep the client from crashing during the server startup, although I don't personally know what's its timeout).

Have you read the MySQL wiki?

Gotcha. Thanks smile

Offline

Board footer

Powered by FluxBB