“Error establishing a database connection” when using the DEFAULT docker-compose.yml file???

[ad_1]

It seems that the database is not created or something by the script

Here is the log
“`
Pulling wordpress (wordpress:)…
latest: Pulling from library/wordpress
9e3ea8720c6d: Pull complete
07353b772b5e: Pull complete
5908153120ba: Pull complete
8681ad2eeea6: Pull complete
92711ce78973: Pull complete
bf1c5be6427e: Pull complete
1d02a81768ed: Pull complete
d674a0135f85: Pull complete
6d87d0359817: Pull complete
5e8c2df9b69e: Pull complete
aacfb138e3c1: Pull complete
2db2528ade33: Pull complete
beeef66f0c04: Pull complete
f06b38c16403: Pull complete
a2c661d6acd5: Pull complete
e4ac8d746152: Pull complete
f264881ab77b: Pull complete
0436c0c6e94a: Pull complete
328897f635d0: Pull complete
b2ea761ddb4a: Pull complete
3d15d55761e9: Pull complete
Digest: sha256:f3b8d54fe9b80e88255121a46933ca1961fb9f3f39e6981a668cdb7f019a5bbd
Status: Downloaded newer image for wordpress:latest
Creating project_wordpress_1 … done
Creating project_db_1 … done
Attaching to project_db_1, project_wordpress_1
db_1 | 2023-05-21 12:05:40+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.42-1.el7 started.
wordpress_1 | AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 172.24.0.2. Set the ‘ServerName’ directive globally to suppress this message
wordpress_1 | AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 172.24.0.2. Set the ‘ServerName’ directive globally to suppress this message
wordpress_1 | [Sun May 21 12:05:40.348867 2023] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.56 (Debian) PHP/8.0.28 configured — resuming normal operations
wordpress_1 | [Sun May 21 12:05:40.348924 2023] [core:notice] [pid 1] AH00094: Command line: ‘apache2 -D FOREGROUND’
wordpress_1 | 172.24.0.1 – – [21/May/2023:12:05:48 +0000] “GET / HTTP/1.1” 500 2834 “-” “Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/113.0”
wordpress_1 | 172.24.0.1 – – [21/May/2023:12:05:50 +0000] “GET / HTTP/1.1” 500 2834 “-” “Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/113.0”
db_1 | 2023-05-21 12:06:33+00:00 [Note] [Entrypoint]: Switching to dedicated user ‘mysql’
db_1 | 2023-05-21 12:06:33+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.42-1.el7 started.
^CGracefully stopping… (press Ctrl+C again to force)
Stopping project_wordpress_1 … done
Stopping project_db_1 … done
[user@computer project]$ docker rm project_wordpress_1 project_db_1
project_wordpress_1
project_db_1
[user@computer project]$ dockerps
CONTAINER ID IMAGE NAMES STATUS
[user@computer project]$ docker-compose -f docker-compose-3.1.yml up
Creating volume “project_wordpress” with default driver
Creating volume “project_db” with default driver
Creating project_wordpress_1 … done
Creating project_db_1 … done
Attaching to project_wordpress_1, project_db_1
wordpress_1 | WordPress not found in /var/www/html – copying now…
db_1 | 2023-05-21 12:07:53+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.42-1.el7 started.
wordpress_1 | Complete! WordPress has been successfully copied to /var/www/html
wordpress_1 | No ‘wp-config.php’ found in /var/www/html, but ‘WORDPRESS_…’ variables supplied; copying ‘wp-config-docker.php’ (WORDPRESS_DB_HOST WORDPRESS_DB_NAME WORDPRESS_DB_PASSWORD WORDPRESS_DB_USER)
wordpress_1 | AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 172.24.0.3. Set the ‘ServerName’ directive globally to suppress this message
wordpress_1 | AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 172.24.0.3. Set the ‘ServerName’ directive globally to suppress this message
wordpress_1 | [Sun May 21 12:07:53.652587 2023] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.56 (Debian) PHP/8.0.28 configured — resuming normal operations
wordpress_1 | [Sun May 21 12:07:53.652610 2023] [core:notice] [pid 1] AH00094: Command line: ‘apache2 -D FOREGROUND’
db_1 | 2023-05-21 12:08:45+00:00 [Note] [Entrypoint]: Switching to dedicated user ‘mysql’
db_1 | 2023-05-21 12:08:45+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.42-1.el7 started.
db_1 | 2023-05-21 12:09:37+00:00 [Note] [Entrypoint]: Initializing database files
db_1 | 2023-05-21T12:09:43.626648Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use –explicit_defaults_for_timestamp server option (see documentation for more details).
db_1 | 2023-05-21T12:09:43.849926Z 0 [Warning] InnoDB: New log files created, LSN=45790
db_1 | 2023-05-21T12:09:43.881330Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
db_1 | 2023-05-21T12:09:43.939575Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 5f1dbb39-f7d0-11ed-9390-0242ac180002.
db_1 | 2023-05-21T12:09:43.940490Z 0 [Warning] Gtid table is not ready to be used. Table ‘mysql.gtid_executed’ cannot be opened.
db_1 | 2023-05-21T12:09:44.103020Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
db_1 | 2023-05-21T12:09:44.103026Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
db_1 | 2023-05-21T12:09:44.103434Z 0 [Warning] CA certificate ca.pem is self signed.
db_1 | 2023-05-21T12:09:44.123582Z 1 [Warning] root@localhost is created with an empty password ! Please consider switching off the –initialize-insecure option.
db_1 | 2023-05-21 12:09:46+00:00 [Note] [Entrypoint]: Database files initialized
db_1 | 2023-05-21 12:09:46+00:00 [Note] [Entrypoint]: Starting temporary server
db_1 | 2023-05-21 12:09:46+00:00 [Note] [Entrypoint]: Waiting for server startup
db_1 | 2023-05-21T12:09:52.468778Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use –explicit_defaults_for_timestamp server option (see documentation for more details).
db_1 | 2023-05-21T12:09:52.472496Z 0 [Note] mysqld (mysqld 5.7.42) starting as process 125 …
db_1 | 2023-05-21T12:09:52.483915Z 0 [Note] InnoDB: PUNCH HOLE support available
db_1 | 2023-05-21T12:09:52.483928Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
db_1 | 2023-05-21T12:09:52.483930Z 0 [Note] InnoDB: Uses event mutexes
db_1 | 2023-05-21T12:09:52.483932Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
db_1 | 2023-05-21T12:09:52.483933Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.13
db_1 | 2023-05-21T12:09:52.483936Z 0 [Note] InnoDB: Using Linux native AIO
db_1 | 2023-05-21T12:09:52.485242Z 0 [Note] InnoDB: Number of pools: 1
db_1 | 2023-05-21T12:09:52.487200Z 0 [Note] InnoDB: Using CPU crc32 instructions
db_1 | 2023-05-21T12:09:52.489331Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
db_1 | 2023-05-21T12:09:52.495414Z 0 [Note] InnoDB: Completed initialization of buffer pool
db_1 | 2023-05-21T12:09:52.497354Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
db_1 | 2023-05-21T12:09:52.511614Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
db_1 | 2023-05-21T12:09:52.524849Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
db_1 | 2023-05-21T12:09:52.524881Z 0 [Note] InnoDB: Setting file ‘./ibtmp1’ size to 12 MB. Physically writing the file full; Please wait …
db_1 | 2023-05-21T12:09:52.541618Z 0 [Note] InnoDB: File ‘./ibtmp1’ size is now 12 MB.
db_1 | 2023-05-21T12:09:52.542157Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
db_1 | 2023-05-21T12:09:52.542164Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
db_1 | 2023-05-21T12:09:52.542679Z 0 [Note] InnoDB: 5.7.42 started; log sequence number 2766912
db_1 | 2023-05-21T12:09:52.542822Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
db_1 | 2023-05-21T12:09:52.543391Z 0 [Note] Plugin ‘FEDERATED’ is disabled.
db_1 | 2023-05-21T12:09:52.548128Z 0 [Note] InnoDB: Buffer pool(s) load completed at 230521 12:09:52
db_1 | 2023-05-21T12:09:52.550614Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
db_1 | 2023-05-21T12:09:52.550621Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
db_1 | 2023-05-21T12:09:52.550623Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
db_1 | 2023-05-21T12:09:52.550624Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
db_1 | 2023-05-21T12:09:52.551645Z 0 [Warning] CA certificate ca.pem is self signed.
db_1 | 2023-05-21T12:09:52.551680Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
db_1 | 2023-05-21T12:09:52.555523Z 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.
db_1 | 2023-05-21T12:09:52.573078Z 0 [Note] Event Scheduler: Loaded 0 events
db_1 | 2023-05-21T12:09:52.573216Z 0 [Note] mysqld: ready for connections.
db_1 | Version: ‘5.7.42’ socket: ‘/var/run/mysqld/mysqld.sock’ port: 0 MySQL Community Server (GPL)
db_1 | 2023-05-21 12:09:52+00:00 [Note] [Entrypoint]: Temporary server started.
db_1 | ‘/var/lib/mysql/mysql.sock’ -> ‘/var/run/mysqld/mysqld.sock’
db_1 | /usr/local/bin/docker-entrypoint.sh: line 113: 125 Killed “$@” –skip-networking –default-time-zone=SYSTEM –socket=”${SOCKET}”
db_1 | ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (111)
db_1 | 2023-05-21 12:10:56+00:00 [Note] [Entrypoint]: Switching to dedicated user ‘mysql’
db_1 | 2023-05-21 12:10:56+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.42-1.el7 started.
db_1 | ‘/var/lib/mysql/mysql.sock’ -> ‘/var/run/mysqld/mysqld.sock’
db_1 | 2023-05-21T12:12:00.401457Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use –explicit_defaults_for_timestamp server option (see documentation for more details).
db_1 | 2023-05-21T12:12:00.404466Z 0 [Note] mysqld (mysqld 5.7.42) starting as process 1 …
db_1 | 2023-05-21T12:12:00.419064Z 0 [Note] InnoDB: PUNCH HOLE support available
db_1 | 2023-05-21T12:12:00.419413Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
db_1 | 2023-05-21T12:12:00.419416Z 0 [Note] InnoDB: Uses event mutexes
db_1 | 2023-05-21T12:12:00.419419Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
db_1 | 2023-05-21T12:12:00.419420Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.13
db_1 | 2023-05-21T12:12:00.419422Z 0 [Note] InnoDB: Using Linux native AIO
db_1 | 2023-05-21T12:12:00.420943Z 0 [Note] InnoDB: Number of pools: 1
db_1 | 2023-05-21T12:12:00.423893Z 0 [Note] InnoDB: Using CPU crc32 instructions
db_1 | 2023-05-21T12:12:00.431692Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
db_1 | 2023-05-21T12:12:00.436591Z 0 [Note] InnoDB: Completed initialization of buffer pool
db_1 | 2023-05-21T12:12:00.437818Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
db_1 | 2023-05-21T12:12:00.451845Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
db_1 | 2023-05-21T12:12:00.453163Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 2766931
db_1 | 2023-05-21T12:12:00.453169Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 2766940
db_1 | 2023-05-21T12:12:00.453172Z 0 [Note] InnoDB: Database was not shutdown normally!
db_1 | 2023-05-21T12:12:00.453174Z 0 [Note] InnoDB: Starting crash recovery.
db_1 | 2023-05-21T12:12:00.571525Z 0 [Note] InnoDB: Removed temporary tablespace data file: “ibtmp1”
db_1 | 2023-05-21T12:12:00.571537Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
db_1 | 2023-05-21T12:12:00.571561Z 0 [Note] InnoDB: Setting file ‘./ibtmp1’ size to 12 MB. Physically writing the file full; Please wait …
db_1 | 2023-05-21T12:12:00.588376Z 0 [Note] InnoDB: File ‘./ibtmp1’ size is now 12 MB.
db_1 | 2023-05-21T12:12:00.588905Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
db_1 | 2023-05-21T12:12:00.588911Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
db_1 | 2023-05-21T12:12:00.589330Z 0 [Note] InnoDB: 5.7.42 started; log sequence number 2766940
db_1 | 2023-05-21T12:12:00.589402Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
db_1 | 2023-05-21T12:12:00.589965Z 0 [Note] Plugin ‘FEDERATED’ is disabled.
db_1 | 2023-05-21T12:12:00.592660Z 0 [Note] InnoDB: Buffer pool(s) load completed at 230521 12:12:00
db_1 | 2023-05-21T12:12:00.599884Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
db_1 | 2023-05-21T12:12:00.599890Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
db_1 | 2023-05-21T12:12:00.599892Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
db_1 | 2023-05-21T12:12:00.599894Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
db_1 | 2023-05-21T12:12:00.600685Z 0 [Warning] CA certificate ca.pem is self signed.
db_1 | 2023-05-21T12:12:00.600717Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
db_1 | 2023-05-21T12:12:00.601935Z 0 [Note] Server hostname (bind-address): ‘*’; port: 3306
db_1 | 2023-05-21T12:12:00.601961Z 0 [Note] IPv6 is available.
db_1 | 2023-05-21T12:12:00.602110Z 0 [Note] – ‘::’ resolves to ‘::’;
db_1 | 2023-05-21T12:12:00.602122Z 0 [Note] Server socket created on IP: ‘::’.
db_1 | 2023-05-21T12:12:00.604501Z 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.
db_1 | 2023-05-21T12:12:00.619801Z 0 [Note] Event Scheduler: Loaded 0 events
db_1 | 2023-05-21T12:12:00.619918Z 0 [Note] mysqld: ready for connections.

“`

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer