# Ls: cannot access '/var/lib/mysql/mysql.sock': No such file or directory

**URL:** <https://forums.percona.com/t/ls-cannot-access-var-lib-mysql-mysql-sock-no-such-file-or-directory/23674>\
**Category:** Uncategorized\
**Created:** [July 16, 2023, 6:37pm UTC](https://forums.percona.com/t/ls-cannot-access-var-lib-mysql-mysql-sock-no-such-file-or-directory/23674 "2023-07-16T18:37:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![parttime](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@parttime](https://forums.percona.com/u/parttime)\
**Post date:** [July 16, 2023, 6:37pm UTC](https://forums.percona.com/t/ls-cannot-access-var-lib-mysql-mysql-sock-no-such-file-or-directory/23674/1 "2023-07-16T18:37:09Z")

</div>

hi,  
when ı start mysqld service, ı get error. when ı starting mysqld /mysql.sock not directory.  
how can ı resolve?

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’

---

<div class="post-metadata">

**Author:** ![Vadim\_Yalovets](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/vadim_yalovets/32/43_2.png) [@Vadim\_Yalovets](https://forums.percona.com/u/Vadim_Yalovets)\
**Post date:** [July 16, 2023, 8:25pm UTC](https://forums.percona.com/t/ls-cannot-access-var-lib-mysql-mysql-sock-no-such-file-or-directory/23674/2 "2023-07-16T20:25:48Z")

</div>

Hi Gungor,

Could you check location of the socket on your installation?

```auto
find / -name mysql.sock

```

e.g.

 ![mysql-8.0.32-8.0.33](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/f/f0a6ee7ad883c69e1a6d1ff6bf3b4f893cbbbafc.png)

---

<div class="post-metadata">

**Author:** ![lalit.choudhary](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/lalit.choudhary/32/51_2.png) [@lalit.choudhary](https://forums.percona.com/u/lalit.choudhary)\
**Post date:** [July 17, 2023, 6:50am UTC](https://forums.percona.com/t/ls-cannot-access-var-lib-mysql-mysql-sock-no-such-file-or-directory/23674/3 "2023-07-17T06:50:47Z")

</div>

Hello @parttime

Places where you can check socket file config depending on MySQL installation method,

- Configuration file: my.cnf
- mysqld process: ps -ef | grep -i mysqld
- find / -name mysql.sock

After getting the socket file path details check if the directory exists, and if it’s, make sure it has correct ownership and file permission.
