Courseiva
mediumMultiple Choice

XK0-006 Practice Question: Based on the exhibit, what is the most likely…

Exhibit

Refer to the exhibit.

```
$ cat /var/log/containers/web.log | grep "ERROR" | head -5
[2024-03-21 10:15:23] ERROR: Connection refused to database at 10.0.0.1:3306
[2024-03-21 10:15:24] ERROR: Connection refused to database at 10.0.0.1:3306
[2024-03-21 10:15:25] ERROR: Connection refused to database at 10.0.0.1:3306
[2024-03-21 10:15:26] ERROR: Connection refused to database at 10.0.0.1:3306
[2024-03-21 10:15:27] ERROR: Connection refused to database at 10.0.0.1:3306
```

Based on the exhibit, what is the most likely cause of the repeated connection refused errors?

⚠ Common exam trap

CompTIA often tests the distinction between 'connection refused' (service down) and 'connection timeout' (firewall blocking) — candidates confuse the two because both prevent access, but the TCP error message uniquely identifies the cause.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

The database service is down.

The 'connection refused' error indicates that the client's TCP SYN packet reached the target host on port 3306, but the host actively rejected the connection because no process is listening on that port. This is the classic symptom of the MySQL/MariaDB database service being stopped or crashed, as the OS TCP stack sends an RST packet when a connection attempt hits a port with no listening socket.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    The DNS resolution for the database host fails.

    Why it's wrong here

    A DNS failure produces name-resolution errors such as "unknown host", not connection refused, which means the name resolved but the TCP handshake was actively rejected. DNS troubleshooting would be the right path when clients cannot translate the database hostname at all.

  • ✗

    A firewall is blocking port 3306.

    Why it's wrong here

    A firewall blocking port 3306 typically causes timeouts or silent drops, not immediate refusal; refusal means the packet reached the host and no listener accepted it. Firewall rules are the correct focus when traffic is filtered before reaching the service.

  • ✓

    The database service is down.

    Why this is correct

    Connection refused means the TCP port is reachable but nothing is listening, so the database service itself is not running. A firewall drop would typically time out rather than refuse, confirming the service is down.

  • ✗

    The database credentials are incorrect.

    Why it's wrong here

    Bad credentials yield authentication failures after the TCP session is established, whereas connection refused occurs before any login exchange. Credential correction is the right fix when logs show access-denied or authentication errors rather than refused sockets.

Visual reference

Client Server SYN (seq=100) SYN-ACK (seq=200, ack=101) ACK (ack=201) Connection established — data transfer begins

About these practice questions

One of 781 original XK0-006 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This XK0-006 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the XK0-006 exam.