Background
After I deployed my phpMyAdmin to my kubernetes cluster and ran it, I was astonished by the UI, which only allows you type username and password, there is no way to input my mysql server's host!
Analysis
Seems phpMyAdmin by default only allows you connect to mysql server deployed in the same machine with the phpMyAdmin itself, in terms of this I would say I love adminer more!
Solution
You need to set
PMA_HOST
to your mysql server host before running the phpMyAdmin instance.
So if you are deploying your phpMyAdmin to your kubernetes cluster, you should edit the
deployment.yaml
as follows:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: phpmyadmin
tier: backend
name: phpmyadmin
spec:
minReadySeconds: 5
selector:
matchLabels:
app: phpmyadmin
tier: backend
template:
metadata:
labels:
app: phpmyadmin
tier: backend
spec:
imagePullSecrets:
- name: harbor-odp
containers:
- image: "phpmyadmin"
env:
- name: PMA_HOST
value: your-my-sql-db.yourhost.com.cn
imagePullPolicy: Always
name: phpmyadmin
ports:
- containerPort: 80
name: http
protocol: TCP
resources:
limits:
cpu: 500m
memory: 128Mi
requests:
cpu: 250m
memory: 64Mi