# Ubernetes pods Can't connect to local MySQL server through socket

**URL:** <https://discuss.kubernetes.io/t/ubernetes-pods-cant-connect-to-local-mysql-server-through-socket/27127>\
**Category:** General Discussions\
**Created:** [February 16, 2024, 8:32pm UTC](https://discuss.kubernetes.io/t/ubernetes-pods-cant-connect-to-local-mysql-server-through-socket/27127 "2024-02-16T20:32:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nkartem](https://avatars.discourse-cdn.com/v4/letter/n/ee59a6/32.png) [@nkartem](https://discuss.kubernetes.io/u/nkartem)\
**Post date:** [February 16, 2024, 8:32pm UTC](https://discuss.kubernetes.io/t/ubernetes-pods-cant-connect-to-local-mysql-server-through-socket/27127/1 "2024-02-16T20:32:04Z")

</div>

### Cluster information:

Kubernetes version: 1.28  
Cloud being used: (put bare-metal if not on a public cloud)  
Installation method: EKS  
Host OS: AL2

Hi

I have a problem with MariaDB (mysqld.sock)  
I have the next architecture:

1. Deployment for APP1
2. Deployment for MariaDB1
3. PV11 and PVC11 (/var/lib/mysql/), PV12 and PVC12 (/run/mysql/)
4. NFS1 server. Database and mysqld.sock save in NFS
5. Namespace1  
From deployment MariaDB1 I get files DB and mysqld.sock saved in NFS server and than mounted to deployment for app1. The APP1 works well.  
And I have exactly the same application 2 which does not work via the socket.  
When I connect to MySQL via mysqld.sock from pod APP1 I have a connection.  
But when I connect to MySQL via mysqld.sock from pod APP2 I have an error.

mysql -S /opt/mariadb-mysqld/mysqld.sock -u root -p ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/opt/mariadb-mysqld/mysqld.sock’ (111)

 ![mysql_sock.drawio](https://us1.discourse-cdn.com/flex016/uploads/kubernetes/original/2X/9/98b0e57c90139f0ea026475f95a3b57ae134e72e.png)
