S
S
Sergey Burduzha2017-09-13 16:11:20
MySQL
Sergey Burduzha, 2017-09-13 16:11:20

How to solve the problem "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13 "Permission denied")"?

At first I got this error

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

Found a solution on this mysql site , after which the error came from the header.
Here are the permissions set on the mysql.sock folder and file
┌─(/var/run/mysqld)───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────([email protected]:pts/17)─┐
└─(16:06:24)──> ll                                                                                                                                            ──(Ср,сен13)─┘
итого 0
drwxr-xr-x  2 mysql root  60 сен 13 15:54 ./
drwxr-xr-x 29 root  root 900 сен 13 13:49 ../
prw-r--r--  1 mysql root   0 сен 13 15:54 mysqld.sock|

I mean that the reason is connected with the rights.
It's strange, but I don't have a mysql group, as in the article, I created it myself and added to it, in my opinion I did it in vain.
How to decide? Thanks in advance.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Burduzha, 2017-09-13
@serii81

Restored the system and mysql earned, the only way so far

I
Ilya Beloborodov, 2017-09-13
@kowap

as a host, instead of localhost , write 127.0.0.1 or vice versa

R
RidgeA, 2017-09-13
@RidgeA

according to the output of ll
, you have a mysql user and the root group
should be vice versa
, perhaps after that you need to re-login
or hang mysql on a tcp socket, as advised by Ilya Beloborodov

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question