# Wordpress and MySQL: Error establishing a database connection

**URL:** <https://discuss.kubernetes.io/t/wordpress-and-mysql-error-establishing-a-database-connection/10469>\
**Category:** General Discussions\
**Created:** [April 10, 2020, 9:07am UTC](https://discuss.kubernetes.io/t/wordpress-and-mysql-error-establishing-a-database-connection/10469 "2020-04-10T09:07:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cielvuong](https://avatars.discourse-cdn.com/v4/letter/c/eb8c5e/32.png) [@cielvuong](https://discuss.kubernetes.io/u/cielvuong)\
**Post date:** [April 10, 2020, 9:07am UTC](https://discuss.kubernetes.io/t/wordpress-and-mysql-error-establishing-a-database-connection/10469/1 "2020-04-10T09:07:46Z")

</div>

Hi, I am trying to launch a demo application with Kubernetes, and I follow this [Example: Deploying WordPress and MySQL with Persistent Volumes - Kubernetes](https://kubernetes.io/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume/)

I used kubeadm, create a cluster with 1 master and 1 worker. I changed the service type to NodePort, create PV. Everything is running now but I can not access the service because " Error establishing a database connection"

This is my YML files:

> **[blakenguyen97/demo-k8s-wordpress](https://github.com/blakenguyen97/demo-k8s-wordpress)**
>
> Contribute to blakenguyen97/demo-k8s-wordpress development by creating an account on GitHub.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/kubernetes/original/2X/9/9d589391e52b44094ca040d47d5901b35591c0b5.png)

 ![image](https://us1.discourse-cdn.com/flex016/uploads/kubernetes/original/2X/4/42adcfae8bb3d15e8754200beb11bac067326367.png)

Thanks for your supporting

---

<div class="post-metadata">

**Author:** ![NGUYEN\_NGUYEN](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/nguyen_nguyen/32/15676_2.png) [@NGUYEN\_NGUYEN](https://discuss.kubernetes.io/u/NGUYEN_NGUYEN)\
**Post date:** [November 4, 2024, 2:41am UTC](https://discuss.kubernetes.io/t/wordpress-and-mysql-error-establishing-a-database-connection/10469/2 "2024-11-04T02:41:26Z")

</div>

I have the same error, please support me fix it

---

<div class="post-metadata">

**Author:** ![NGUYEN\_NGUYEN](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/nguyen_nguyen/32/15676_2.png) [@NGUYEN\_NGUYEN](https://discuss.kubernetes.io/u/NGUYEN_NGUYEN)\
**Post date:** [November 4, 2024, 2:42am UTC](https://discuss.kubernetes.io/t/wordpress-and-mysql-error-establishing-a-database-connection/10469/3 "2024-11-04T02:42:46Z")

</div>

I think the connect from the Wordpress to MySQL have error, I try to connect but it still cannot connect.
