Wordpress: Error establishing a database connection

i there!

I have a docker instance running in portainer using the wordpress app template.

I tried to clean up my docker instance a bit so i tried to set the network from wordpress_default to bridge. I did this for the wordpress app and as well for the database. I also changed this in the docker compose options for both containers.

However, when i updated the containers i’m getting a Error establishing a database connection error. Now I’ve restored the settings back to wordpress_default but the database error persists.

I’m getting the following error in my app container:

[Mon Jun 26 21:29:36.485880 2023] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.56 (Debian) PHP/8.0.29 configured -- resuming normal operations
192.168.2.107 - - [26/Jun/2023:21:32:57 +0000] "GET /favicon.ico HTTP/1.1" 500 2834 "http://192.168.2.250:8083/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
172.71.102.14 - - [26/Jun/2023:21:30:28 +0000] "GET / HTTP/1.1" 500 2834 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
[Mon Jun 26 21:29:36.485929 2023] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
192.168.2.107 - - [26/Jun/2023:21:32:57 +0000] "GET / HTTP/1.1" 500 2834 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.23.0.2. Set the 'ServerName' directive globally to suppress this message
[Mon Jun 26 21:29:34.783343 2023] [mpm_prefork:notice] [pid 1] AH00170: caught SIGWINCH, shutting down gracefully
172.71.182.167 - - [26/Jun/2023:21:28:53 +0000] "GET / HTTP/1.1" 500 2834 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"

and my db gives the following:

Version: '5.7.42' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL)
2023-06-26T21:29:39.735775Z 0 [Note] mysqld: ready for connections.
2023-06-26T21:29:39.735544Z 0 [Note] Event Scheduler: Loaded 0 events
2023-06-26T21:29:39.735225Z 0 [Warning] Optional native table 'performance_schema'.'processlist' has the wrong structure or is missing.
2023-06-26T21:29:39.728067Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2023-06-26T21:29:39.724731Z 0 [Note] Server socket created on IP: '::'.
2023-06-26T21:29:39.724712Z 0 [Note] - '::' resolves to '::';
2023-06-26T21:29:39.724699Z 0 [Note] IPv6 is available.
2023-06-26T21:29:39.724661Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2023-06-26T21:29:39.724408Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2023-06-26T21:29:39.724363Z 0 [Warning] CA certificate ca.pem is self signed.
2023-06-26T21:29:39.723788Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2023-06-26T21:29:39.723757Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2023-06-26T21:29:39.720678Z 0 [Note] InnoDB: Buffer pool(s) load completed at 230626 21:29:39
2023-06-26T21:29:39.718917Z 0 [Note] Plugin 'FEDERATED' is disabled.
2023-06-26T21:29:39.723766Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2023-06-26T21:29:39.723786Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2023-06-26T21:29:39.718756Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2023-06-26T21:29:39.718636Z 0 [Note] InnoDB: 5.7.42 started; log sequence number 235685154
2023-06-26T21:29:39.718322Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2023-06-26T21:29:39.718316Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.

Can anyone pleae help me and explain what is going on ? I’m freaking out :frowning:

This are my app settings:

{
    "AppArmorProfile": "docker-default",
    "Args": [
        "apache2-foreground"
    ],
    "Config": {
        "AttachStderr": true,
        "AttachStdin": false,
        "AttachStdout": true,
        "Cmd": [
            "apache2-foreground"
        ],
        "Domainname": "",
        "Entrypoint": [
            "docker-entrypoint.sh"
        ],
        "Env": [
            "WORDPRESS_DB_PASSWORD=XXX",
            "WORDPRESS_DB_NAME=wordpress",
            "WORDPRESS_DB_HOST=db-wordpress:3306",
            "WORDPRESS_DB_USER=wordpress",
            "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
            "PHPIZE_DEPS=autoconf \t\tdpkg-dev \t\tfile \t\tg++ \t\tgcc \t\tlibc-dev \t\tmake \t\tpkg-config \t\tre2c",
            "PHP_INI_DIR=/usr/local/etc/php",
            "APACHE_CONFDIR=/etc/apache2",
            "APACHE_ENVVARS=/etc/apache2/envvars",
            "PHP_CFLAGS=-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64",
            "PHP_CPPFLAGS=-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64",
            "PHP_LDFLAGS=-Wl,-O1 -pie",
            "GPG_KEYS=XXX",
            "PHP_VERSION=8.0.29",
            "PHP_URL=https://www.php.net/distributions/php-8.0.29.tar.xz",
            "PHP_ASC_URL=https://www.php.net/distributions/php-8.0.29.tar.xz.asc",
            "PHP_SHA256=XXX"
        ],
        "ExposedPorts": {
            "80/tcp": {}
        },
        "Hostname": "839cf67fcf03",
        "Image": "wordpress:latest",
        "Labels": {
            "com.docker.compose.config-hash": "XXX",
            "com.docker.compose.container-number": "1",
            "com.docker.compose.depends_on": "db-wordpress:service_started",
            "com.docker.compose.image": "sha256:8fec96b2307fddc778eeffbcab6cd9213d0c3a5c757eaf3b149288fc7461fc70",
            "com.docker.compose.oneoff": "False",
            "com.docker.compose.project": "wordpress",
            "com.docker.compose.project.config_files": "/data/compose/11/docker-compose.yml",
            "com.docker.compose.project.working_dir": "/data/compose/11",
            "com.docker.compose.service": "wordpress",
            "com.docker.compose.version": "2.13.0"
        },
        "OnBuild": null,
        "OpenStdin": false,
        "StdinOnce": false,
        "StopSignal": "SIGWINCH",
        "Tty": false,
        "User": "",
        "Volumes": {
            "/var/www/html": {}
        },
        "WorkingDir": "/var/www/html"
    },
    "Created": "2023-06-26T21:20:34.664458259Z",
    "Driver": "overlay2",
    "ExecIDs": null,
    "GraphDriver": {
        "Data": {
            "LowerDir": "/var/lib/docker/overlay2/577c1ddb339919bbab12ba3763a1e3f16bbd2ed5c1a49a16979314bf247fc82d-init/diff:/var/lib/docker/overlay2/59fa144cbef3cdfb825992699c49c478d09aaebc011e62f94b62b3a2a61c32ae/diff:/var/lib/docker/overlay2/6244b8c6a45ae3072ce4a446ef17b4244af31d17cb57c4453fe7e724966379c9/diff:/var/lib/docker/overlay2/d2410cb23813ee3480afc46f2314925a7bde35706d9d96bb41df0ab1b58c234b/diff:/var/lib/docker/overlay2/f7b2d851371df2baf230372be190c1af6a191604c40c204289968ced3d929ee1/diff:/var/lib/docker/overlay2/e3789f89698ff186a843baa58f27a641156a6009a2515764f95a48e88887d157/diff:/var/lib/docker/overlay2/4a5c630fd93fa6117495d4d2decb960f1e9112fa249e13612e06d08e2cfaf8a2/diff:/var/lib/docker/overlay2/95b1dba5c2e3dba893514e73399dc08b0193fb9eafd713e89380406c6cdbc6cc/diff:/var/lib/docker/overlay2/5326d9ae6cea1591c30e8e91b43e6bf330ca7a914ae5a7bb3c6117d26f24fecb/diff:/var/lib/docker/overlay2/fd86f406995847a71629c25a0bba6f8008331799fb978acab72d0235d60f20ae/diff:/var/lib/docker/overlay2/82220fb2d474ab7801cbd89e973aee249392235440080e22e0c3b404c808bfff/diff:/var/lib/docker/overlay2/71e898a1df9d30b843a474644ec9ce79844bc064898119a9a02fb666618ec5e1/diff:/var/lib/docker/overlay2/18c206236d6f8d167fd1533b42f4f8523947d30ab68612e3af41c334e7e44cd2/diff:/var/lib/docker/overlay2/485d530792af4370409b7ff1f7b977e516d23556123181be0f7eaf47b2229f01/diff:/var/lib/docker/overlay2/f17c73331e709205b1eea5d72e94bdb9017ca3149bc2dec67afc8ee12cdb9c97/diff:/var/lib/docker/overlay2/04bee5b595e461be3657787b2e97ab1586e1acdcfcc45f550af5d0ccc94f3614/diff:/var/lib/docker/overlay2/1104dc3b1351e9da82135741b0f4a0ac6b5e2e3a4d7b8a3ed79dd21cb1ee1a06/diff:/var/lib/docker/overlay2/6299a5c955f049e855ed9ab3b52e5742c7c5b04a4c296127c58f7924caab0b67/diff:/var/lib/docker/overlay2/43668e81c109b26c79385a88e1d401734f963945d2143a22cbb1a11242bf5cbf/diff:/var/lib/docker/overlay2/e1e53d609a095f180c4bece534210c867ec874c2c1fbb48855bb7cc64b704223/diff:/var/lib/docker/overlay2/d72c4c318f43c248e3bb7a4a35b1b727ba9c470985719f668ca7b0d6dd15edf4/diff:/var/lib/docker/overlay2/861d10549482bcf720043791fe89bc592457916df68292ccbbf0ca5947464d67/diff",
            "MergedDir": "/var/lib/docker/overlay2/577c1ddb339919bbab12ba3763a1e3f16bbd2ed5c1a49a16979314bf247fc82d/merged",
            "UpperDir": "/var/lib/docker/overlay2/577c1ddb339919bbab12ba3763a1e3f16bbd2ed5c1a49a16979314bf247fc82d/diff",
            "WorkDir": "/var/lib/docker/overlay2/577c1ddb339919bbab12ba3763a1e3f16bbd2ed5c1a49a16979314bf247fc82d/work"
        },
        "Name": "overlay2"
    },
    "HostConfig": {
        "AutoRemove": false,
        "Binds": [
            "/home/planet/Docker/wordpress/wordpress_data:/var/www/html"
        ],
        "BlkioDeviceReadBps": null,
        "BlkioDeviceReadIOps": null,
        "BlkioDeviceWriteBps": null,
        "BlkioDeviceWriteIOps": null,
        "BlkioWeight": 0,
        "BlkioWeightDevice": null,
        "CapAdd": [
            "AUDIT_WRITE",
            "CHOWN",
            "DAC_OVERRIDE",
            "FOWNER",
            "FSETID",
            "KILL",
            "MKNOD",
            "NET_BIND_SERVICE",
            "NET_RAW",
            "SETFCAP",
            "SETGID",
            "SETPCAP",
            "SETUID",
            "SYS_CHROOT"
        ],
        "CapDrop": [
            "AUDIT_CONTROL",
            "BLOCK_SUSPEND",
            "DAC_READ_SEARCH",
            "IPC_LOCK",
            "IPC_OWNER",
            "LEASE",
            "LINUX_IMMUTABLE",
            "MAC_ADMIN",
            "MAC_OVERRIDE",
            "NET_ADMIN",
            "NET_BROADCAST",
            "SYSLOG",
            "SYS_ADMIN",
            "SYS_BOOT",
            "SYS_MODULE",
            "SYS_NICE",
            "SYS_PACCT",
            "SYS_PTRACE",
            "SYS_RAWIO",
            "SYS_RESOURCE",
            "SYS_TIME",
            "SYS_TTY_CONFIG",
            "WAKE_ALARM"
        ],
        "Cgroup": "",
        "CgroupParent": "",
        "CgroupnsMode": "private",
        "ConsoleSize": [
            0,
            0
        ],
        "ContainerIDFile": "",
        "CpuCount": 0,
        "CpuPercent": 0,
        "CpuPeriod": 0,
        "CpuQuota": 0,
        "CpuRealtimePeriod": 0,
        "CpuRealtimeRuntime": 0,
        "CpuShares": 0,
        "CpusetCpus": "",
        "CpusetMems": "",
        "DeviceCgroupRules": null,
        "DeviceRequests": null,
        "Devices": [],
        "Dns": [],
        "DnsOptions": [],
        "DnsSearch": [],
        "ExtraHosts": [],
        "GroupAdd": null,
        "IOMaximumBandwidth": 0,
        "IOMaximumIOps": 0,
        "IpcMode": "private",
        "Isolation": "",
        "KernelMemory": 0,
        "KernelMemoryTCP": 0,
        "Links": null,
        "LogConfig": {
            "Config": {},
            "Type": "journald"
        },
        "MaskedPaths": [
            "/proc/asound",
            "/proc/acpi",
            "/proc/kcore",
            "/proc/keys",
            "/proc/latency_stats",
            "/proc/timer_list",
            "/proc/timer_stats",
            "/proc/sched_debug",
            "/proc/scsi",
            "/sys/firmware"
        ],
        "Memory": 0,
        "MemoryReservation": 0,
        "MemorySwap": 0,
        "MemorySwappiness": null,
        "NanoCpus": 0,
        "NetworkMode": "wordpress_default",
        "OomKillDisable": null,
        "OomScoreAdj": 0,
        "PidMode": "",
        "PidsLimit": null,
        "PortBindings": {
            "80/tcp": [
                {
                    "HostIp": "",
                    "HostPort": "8083"
                }
            ]
        },
        "Privileged": false,
        "PublishAllPorts": false,
        "ReadonlyPaths": [
            "/proc/bus",
            "/proc/fs",
            "/proc/irq",
            "/proc/sys",
            "/proc/sysrq-trigger"
        ],
        "ReadonlyRootfs": false,
        "RestartPolicy": {
            "MaximumRetryCount": 0,
            "Name": "always"
        },
        "Runtime": "runc",
        "SecurityOpt": null,
        "ShmSize": 67108864,
        "UTSMode": "",
        "Ulimits": null,
        "UsernsMode": "",
        "VolumeDriver": "",
        "VolumesFrom": null
    },
    "HostnamePath": "/var/lib/docker/containers/372cf7b47597c7fd748a3d4cd66ecf56189dd1d44d1597f55778eae4deb6b42c/hostname",
    "HostsPath": "/var/lib/docker/containers/372cf7b47597c7fd748a3d4cd66ecf56189dd1d44d1597f55778eae4deb6b42c/hosts",
    "Id": "XXX",
    "Image": "sha256:1c5f5d58cc6d2c2ba76cd0cc3e1cf582ade2e455cf7d1883585a48feae27deb4",
    "LogPath": "",
    "MountLabel": "",
    "Mounts": [
        {
            "Destination": "/var/www/html",
            "Mode": "",
            "Propagation": "rprivate",
            "RW": true,
            "Source": "/home/planet/Docker/wordpress/wordpress_data",
            "Type": "bind"
        }
    ],
    "Name": "/wordpress-app",
    "NetworkSettings": {
        "Bridge": "",
        "EndpointID": "",
        "Gateway": "",
        "GlobalIPv6Address": "",
        "GlobalIPv6PrefixLen": 0,
        "HairpinMode": false,
        "IPAddress": "",
        "IPPrefixLen": 0,
        "IPv6Gateway": "",
        "LinkLocalIPv6Address": "",
        "LinkLocalIPv6PrefixLen": 0,
        "MacAddress": "",
        "Networks": {
            "wordpress_default": {
                "Aliases": [
                    "372cf7b47597",
                    "839cf67fcf03"
                ],
                "DriverOpts": null,
                "EndpointID": "XXX",
                "Gateway": "172.23.0.1",
                "GlobalIPv6Address": "",
                "GlobalIPv6PrefixLen": 0,
                "IPAMConfig": {},
                "IPAddress": "172.23.0.2",
                "IPPrefixLen": 16,
                "IPv6Gateway": "",
                "Links": null,
                "MacAddress": "02:42:ac:17:00:02",
                "NetworkID": "e50cee81d109da13c11ba23539e3887350b16b3139cc14ac202d97e42df12c76"
            }
        },
        "Ports": {
            "80/tcp": [
                {
                    "HostIp": "0.0.0.0",
                    "HostPort": "8083"
                },
                {
                    "HostIp": "::",
                    "HostPort": "8083"
                }
            ]
        },
        "SandboxID": "XXX",
        "SandboxKey": "/var/run/docker/netns/XXX",
        "SecondaryIPAddresses": null,
        "SecondaryIPv6Addresses": null
    },
    "Path": "docker-entrypoint.sh",
    "Platform": "linux",
    "Portainer": {
        "ResourceControl": {
            "Id": 80,
            "ResourceId": "XXX",
            "SubResourceIds": [],
            "Type": 1,
            "UserAccesses": [],
            "TeamAccesses": [],
            "Public": false,
            "AdministratorsOnly": true,
            "System": false
        }
    },
    "ProcessLabel": "",
    "ResolvConfPath": "/var/lib/docker/containers/372cf7b47597c7fd748a3d4cd66ecf56189dd1d44d1597f55778eae4deb6b42c/resolv.conf",
    "RestartCount": 0,
    "State": {
        "Dead": false,
        "Error": "",
        "ExitCode": 0,
        "FinishedAt": "2023-06-26T21:29:35.808744749Z",
        "OOMKilled": false,
        "Paused": false,
        "Pid": 331016,
        "Restarting": false,
        "Running": true,
        "StartedAt": "2023-06-26T21:29:36.420643599Z",
        "Status": "running"
    }
}

and for my db:

{
    "AppArmorProfile": "docker-default",
    "Args": [
        "mysqld"
    ],
    "Config": {
        "AttachStderr": true,
        "AttachStdin": false,
        "AttachStdout": true,
        "Cmd": [
            "mysqld"
        ],
        "Domainname": "",
        "Entrypoint": [
            "docker-entrypoint.sh"
        ],
        "Env": [
            "MYSQL_PASSWORD=XXX",
            "MYSQL_ROOT_PASSWORD=XXX",
            "MYSQL_DATABASE=wordpress",
            "MYSQL_USER=wordpress",
            "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
            "GOSU_VERSION=1.16",
            "MYSQL_MAJOR=5.7",
            "MYSQL_VERSION=5.7.42-1.el7",
            "MYSQL_SHELL_VERSION=8.0.33-1.el7"
        ],
        "ExposedPorts": {
            "3306/tcp": {},
            "33060/tcp": {}
        },
        "Hostname": "817341f0896b",
        "Image": "mysql:5.7",
        "Labels": {
            "com.docker.compose.config-hash": "XXX",
            "com.docker.compose.container-number": "1",
            "com.docker.compose.depends_on": "",
            "com.docker.compose.image": "sha256:0018a8d838923d94318aa8dd3195510226b31540901a6f4c643aacec69f7ab62",
            "com.docker.compose.oneoff": "False",
            "com.docker.compose.project": "wordpress",
            "com.docker.compose.project.config_files": "/data/compose/11/docker-compose.yml",
            "com.docker.compose.project.working_dir": "/data/compose/11",
            "com.docker.compose.service": "db-wordpress",
            "com.docker.compose.version": "2.13.0"
        },
        "OnBuild": null,
        "OpenStdin": false,
        "StdinOnce": false,
        "Tty": false,
        "User": "",
        "Volumes": {
            "/var/lib/mysql": {}
        },
        "WorkingDir": ""
    },
    "Created": "2023-06-26T21:21:04.262018924Z",
    "Driver": "overlay2",
    "ExecIDs": null,
    "GraphDriver": {
        "Data": {
            "LowerDir": "/var/lib/docker/overlay2/5ccffa1411abf074c3aaf82253ba7cda95892a6b20b8616705929749dfd98c78-init/diff:/var/lib/docker/overlay2/6cc3c56ee7182dc848ceb9b4b51ab2afcb0ef4041ced17e1f1e89bb6492a6303/diff:/var/lib/docker/overlay2/fc9e7e79d6d37faac317d33ecf6c64c55b99db35e11b2a63a6e1243193595502/diff:/var/lib/docker/overlay2/751e68c562b628721e570f0b275061bd82701dbbe8dc94670962dd912dfaa614/diff:/var/lib/docker/overlay2/c316a5b13db9c4c130ca6e42f181d42d9c1cfc340b7e07f233b61557a594253b/diff:/var/lib/docker/overlay2/bfb415a44729538ec27b98a43a2e71b25cd4ad1fb369b3f850f15e232ff6f5b8/diff:/var/lib/docker/overlay2/b4bede6d1977d748151ef58276bc8392e44355d2a88a54c72a080db736370c30/diff:/var/lib/docker/overlay2/7df0df0bd63a93348543762d0db0e8b47d5b8b2c35925b72c476e6947b2f47ba/diff:/var/lib/docker/overlay2/7a87acad61c5e40c1f030064af9028abedc36c12b2b612758f5185222e041a95/diff:/var/lib/docker/overlay2/958dfa45c13d1c129ea37aa992e51f1529d279e2d6758ef27cab7ed3a82bafde/diff:/var/lib/docker/overlay2/6ffaba56f7e717c3299c338f2f0df2141df542191b045c624ed136bd4ba1b8a6/diff:/var/lib/docker/overlay2/6d041259b9367543f72ce36839d11034efd4397ba61819f87c6793a1b4dfac4f/diff",
            "MergedDir": "/var/lib/docker/overlay2/5ccffa1411abf074c3aaf82253ba7cda95892a6b20b8616705929749dfd98c78/merged",
            "UpperDir": "/var/lib/docker/overlay2/5ccffa1411abf074c3aaf82253ba7cda95892a6b20b8616705929749dfd98c78/diff",
            "WorkDir": "/var/lib/docker/overlay2/5ccffa1411abf074c3aaf82253ba7cda95892a6b20b8616705929749dfd98c78/work"
        },
        "Name": "overlay2"
    },
    "HostConfig": {
        "AutoRemove": false,
        "Binds": [
            "/home/planet/Docker/wordpress/db_data:/var/lib/mysql"
        ],
        "BlkioDeviceReadBps": null,
        "BlkioDeviceReadIOps": null,
        "BlkioDeviceWriteBps": null,
        "BlkioDeviceWriteIOps": null,
        "BlkioWeight": 0,
        "BlkioWeightDevice": null,
        "CapAdd": [
            "AUDIT_WRITE",
            "CHOWN",
            "DAC_OVERRIDE",
            "FOWNER",
            "FSETID",
            "KILL",
            "MKNOD",
            "NET_BIND_SERVICE",
            "NET_RAW",
            "SETFCAP",
            "SETGID",
            "SETPCAP",
            "SETUID",
            "SYS_CHROOT"
        ],
        "CapDrop": [
            "AUDIT_CONTROL",
            "BLOCK_SUSPEND",
            "DAC_READ_SEARCH",
            "IPC_LOCK",
            "IPC_OWNER",
            "LEASE",
            "LINUX_IMMUTABLE",
            "MAC_ADMIN",
            "MAC_OVERRIDE",
            "NET_ADMIN",
            "NET_BROADCAST",
            "SYSLOG",
            "SYS_ADMIN",
            "SYS_BOOT",
            "SYS_MODULE",
            "SYS_NICE",
            "SYS_PACCT",
            "SYS_PTRACE",
            "SYS_RAWIO",
            "SYS_RESOURCE",
            "SYS_TIME",
            "SYS_TTY_CONFIG",
            "WAKE_ALARM"
        ],
        "Cgroup": "",
        "CgroupParent": "",
        "CgroupnsMode": "private",
        "ConsoleSize": [
            0,
            0
        ],
        "ContainerIDFile": "",
        "CpuCount": 0,
        "CpuPercent": 0,
        "CpuPeriod": 0,
        "CpuQuota": 0,
        "CpuRealtimePeriod": 0,
        "CpuRealtimeRuntime": 0,
        "CpuShares": 0,
        "CpusetCpus": "",
        "CpusetMems": "",
        "DeviceCgroupRules": null,
        "DeviceRequests": null,
        "Devices": [],
        "Dns": [],
        "DnsOptions": [],
        "DnsSearch": [],
        "ExtraHosts": [],
        "GroupAdd": null,
        "IOMaximumBandwidth": 0,
        "IOMaximumIOps": 0,
        "IpcMode": "private",
        "Isolation": "",
        "KernelMemory": 0,
        "KernelMemoryTCP": 0,
        "Links": null,
        "LogConfig": {
            "Config": {},
            "Type": "journald"
        },
        "MaskedPaths": [
            "/proc/asound",
            "/proc/acpi",
            "/proc/kcore",
            "/proc/keys",
            "/proc/latency_stats",
            "/proc/timer_list",
            "/proc/timer_stats",
            "/proc/sched_debug",
            "/proc/scsi",
            "/sys/firmware"
        ],
        "Memory": 0,
        "MemoryReservation": 0,
        "MemorySwap": 0,
        "MemorySwappiness": null,
        "NanoCpus": 0,
        "NetworkMode": "wordpress_default",
        "OomKillDisable": null,
        "OomScoreAdj": 0,
        "PidMode": "",
        "PidsLimit": null,
        "PortBindings": {},
        "Privileged": false,
        "PublishAllPorts": false,
        "ReadonlyPaths": [
            "/proc/bus",
            "/proc/fs",
            "/proc/irq",
            "/proc/sys",
            "/proc/sysrq-trigger"
        ],
        "ReadonlyRootfs": false,
        "RestartPolicy": {
            "MaximumRetryCount": 0,
            "Name": "always"
        },
        "Runtime": "runc",
        "SecurityOpt": null,
        "ShmSize": 67108864,
        "UTSMode": "",
        "Ulimits": null,
        "UsernsMode": "",
        "VolumeDriver": "",
        "VolumesFrom": null
    },
    "HostnamePath": "/var/lib/docker/containers/b36aaed3b9192602d9ddfba4bc540e93d91d08547aecac543be2749fe8675467/hostname",
    "HostsPath": "/var/lib/docker/containers/b36aaed3b9192602d9ddfba4bc540e93d91d08547aecac543be2749fe8675467/hosts",
    "Id": "XXX",
    "Image": "sha256:2be84dd575ee2ecdb186dc43a9cd951890a764d2cefbd31a72cdf4410c43a2d0",
    "LogPath": "",
    "MountLabel": "",
    "Mounts": [
        {
            "Destination": "/var/lib/mysql",
            "Mode": "",
            "Propagation": "rprivate",
            "RW": true,
            "Source": "/home/planet/Docker/wordpress/db_data",
            "Type": "bind"
        }
    ],
    "Name": "/wordpress-db",
    "NetworkSettings": {
        "Bridge": "",
        "EndpointID": "",
        "Gateway": "",
        "GlobalIPv6Address": "",
        "GlobalIPv6PrefixLen": 0,
        "HairpinMode": false,
        "IPAddress": "",
        "IPPrefixLen": 0,
        "IPv6Gateway": "",
        "LinkLocalIPv6Address": "",
        "LinkLocalIPv6PrefixLen": 0,
        "MacAddress": "",
        "Networks": {
            "wordpress_default": {
                "Aliases": [
                    "b36aaed3b919",
                    "817341f0896b"
                ],
                "DriverOpts": null,
                "EndpointID": "XXX",
                "Gateway": "172.23.0.1",
                "GlobalIPv6Address": "",
                "GlobalIPv6PrefixLen": 0,
                "IPAMConfig": {},
                "IPAddress": "172.23.0.3",
                "IPPrefixLen": 16,
                "IPv6Gateway": "",
                "Links": null,
                "MacAddress": "02:42:ac:17:00:03",
                "NetworkID": "e50cee81d109da13c11ba23539e3887350b16b3139cc14ac202d97e42df12c76"
            }
        },
        "Ports": {
            "3306/tcp": null,
            "33060/tcp": null
        },
        "SandboxID": "3eae8edfb5039206202ac66aad73048df524ec5499201edc44dede3d3edc21a1",
        "SandboxKey": "/var/run/docker/netns/XXX",
        "SecondaryIPAddresses": null,
        "SecondaryIPv6Addresses": null
    },
    "Path": "docker-entrypoint.sh",
    "Platform": "linux",
    "Portainer": {
        "ResourceControl": {
            "Id": 81,
            "ResourceId": "XXX",
            "SubResourceIds": [],
            "Type": 1,
            "UserAccesses": [],
            "TeamAccesses": [],
            "Public": false,
            "AdministratorsOnly": true,
            "System": false
        }
    },
    "ProcessLabel": "",
    "ResolvConfPath": "/var/lib/docker/containers/b36aaed3b9192602d9ddfba4bc540e93d91d08547aecac543be2749fe8675467/resolv.conf",
    "RestartCount": 0,
    "State": {
        "Dead": false,
        "Error": "",
        "ExitCode": 0,
        "FinishedAt": "2023-06-26T21:29:38.409213722Z",
        "OOMKilled": false,
        "Paused": false,
        "Pid": 331177,
        "Restarting": false,
        "Running": true,
        "StartedAt": "2023-06-26T21:29:39.048337819Z",
        "Status": "running"
    }
}

Hi

Can you share your docker-compose file?
what do you write as your database host when setting up wordpress?

Hi there!

Thank you for your time!

This is my compose file:

version: "3.9"
    
services:
  db-wordpress:
    container_name: wordpress-db
    image: mysql:5.7
    volumes:
      - /home/planet/Docker/wordpress/db_data:/var/lib/mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: somewordpress
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: wordpress
      
  phpmyadmin:
    depends_on:
      - db-wordpress
    image: phpmyadmin/phpmyadmin
    restart: always
    ports:
      - "8085:80"
    environment:
      PMA_HOST: db-wordpress
      MYSQL_ROOT_PASSWORD: somewordpress
    
  wordpress:
    container_name: wordpress-app
    depends_on:
      - db-wordpress
    image: wordpress:latest

    volumes:
      - /home/planet/Docker/wordpress/wordpress_data:/var/www/html
    ports:
      - "8083:80"


    restart: always

    environment:
      WORDPRESS_DB_HOST: db-wordpress:3306
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress
      WORDPRESS_DB_NAME: wordpress
volumes:
  db_data: {}
  wordpress_data: {}

Hi again, does phpmyadmin work? and have you tried using “wordpress-db” as hostname?

I don’T see any error messages in your log, just warnings. One interesting line is this:

Which means your or something stops the container by sending a stop signal. I saw this only when I intentionally ran docker stop containername or the compose equivalent or when I ran the containers in the foreground without passwing -d to the container and resizing the terminal sent a SIGWINCH Apache HTTPD in the container.

The only thing I have noticed is that you are using the latest tag of the wordpress image which is usually not recommended, because the image can change and a newer version might not work the same way as the one that you used before.

Where is that error message? It seems that is missing from the shared log.