Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Error establishing a database connection #50

Open
ghost opened this issue Dec 13, 2018 · 3 comments
Open

Error establishing a database connection #50

ghost opened this issue Dec 13, 2018 · 3 comments
Labels

Comments

@ghost
Copy link

ghost commented Dec 13, 2018

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?

@robalaban
Copy link

Can you post your wp-config.php? Seems like a config error rather than something wrong with your approach.

@Sarvatus
Copy link

Hello,
maybe old issue but:
1.
try create on mysql pod:
mysql -u root -p
mysql> CREATE DATABASE wordpress;

  1. Add in wordpress-deployment.yaml additional env with user for DB
    env:
    - name: WORDPRESS_DB_USER
    value: "root"

for me worked

Regards

@ericmbb
Copy link

ericmbb commented Apr 7, 2021

The comment above worked for me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants