Scalable-WordPress-deployment-on-Kubernetes
Scalable-WordPress-deployment-on-Kubernetes copied to clipboard
Error establishing a database connection
I deployed this per the instruction on a new cluster as well as on minikube. But in both cases, when I access wordpress deployed, I got the the following displayed on the browser screen:
Warning: A non-numeric value encountered in /var/www/html/wp-config.php on line 29 Warning: A non-numeric value encountered in /var/www/html/wp-config.php on line 29 Warning: A non-numeric value encountered in /var/www/html/wp-config.php on line 29 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-config.php:29) in /var/www/html/wp-includes/functions.php on line 3790 Error establishing a database connection
How to fix it?
Can you post your wp-config.php? Seems like a config error rather than something wrong with your approach.
Hello, maybe old issue but: 1. try create on mysql pod: mysql -u root -p mysql> CREATE DATABASE wordpress;
- Add in wordpress-deployment.yaml additional env with user for DB env: - name: WORDPRESS_DB_USER value: "root"
for me worked
Regards
The comment above worked for me.