<p>I have deployed MySQL in my Kubernetes cluster. It works fine. But I am not aware of how to access or connect the MySQL service to other applications. I found that MySQL deployment is not browser-supported.
When I call the MySQL server on the browser using <code>IP:nodeport</code>, I found the following error:</p>
<pre><code>J���
5.7.37����!bo.;�ÿÿ�ÿÁ����������rBPvNbCJ�mysql_native_password�!��ÿ„#08S01Got packets out of order
</code></pre>
<p>I can access the MySQL server through Kubernetes dashboard's pod shell using the MySQL user and password.</p>

ashique
<p>You can try deploying the MySQL client on Kubernetes and connect using it.</p>
<p>MySQL client like : Adminer, phpMyadmin etc</p>
<p>Adminer example :</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: adminer
  labels:
    app: adminer
spec:
  selector:
    matchLabels:
      app: adminer
  template:
    metadata:
      labels:
        app: adminer
    spec:
      containers:
        - name: adminer
          image: adminer:4.6.3
          ports:
            - containerPort: 8080
          env:
            - name: ADMINER_DESIGN
              value: &quot;pappu687&quot;
---
apiVersion: v1
kind: Service
metadata:
  name: adminer-svc
spec:
  selector:
    app: adminer
  ports:
    - protocol: TCP
      port: 8080
      targetPort: 8080
</code></pre>
<p>You can expose this deployment with service type <strong>Nodeport</strong> or <strong>Port forwarding</strong>.</p>
<pre><code>kubectl port-forward svc/adminer-svc 8080:8080
</code></pre>
<p>Open the <code>localhost:8080</code></p>
<p>Once the service is exposed you can access the UI in the browser and from there you can access the MySQL database over the <strong>service name</strong>.</p>
<p>Read more about adminer : <a href="https://www.adminer.org/" rel="nofollow noreferrer">https://www.adminer.org/</a></p>
