1Z0-888 · Question #22
After rebooting the host, you attempt to start the mysqld service. You get the following error: Can't start server: Bind on TCP/IP port: Address already in use What is the most likely cause of this…
The correct answer is E. The mysql.sock file in the MySQL /tmp directory was not removed after the reboot, so mysqld still thinks there is an active server running. Option E is correct because when a MySQL server crashes or is improperly shut down before a reboot, the mysql.sock Unix socket file in /tmp (or /var/lib/mysql/) can persist. When mysqld starts and finds this leftover socket file, it may interpret it as evidence of a running…
Question
Options
- AThe mysql service has already been started on the same port.
- BThe network service process in the server is frozen, so all TCP/IP connections are paused and cannot be reused.
- CYou failed to specify the port number 3306 to the command to start the server, so it is defaulting to port 80, which is in use by the built-in web server.
- DThe /etc/hosts file does not have a valid IP entry for mysqld localhost, so it is binding to 127.0.0.1, which is already in use.
- EThe mysql.sock file in the MySQL /tmp directory was not removed after the reboot, so mysqld still thinks there is an active server running.
How the community answered
(43 responses)- A2% (1)
- B7% (3)
- C9% (4)
- D2% (1)
- E79% (34)
Explanation
Option E is correct because when a MySQL server crashes or is improperly shut down before a reboot, the mysql.sock Unix socket file in /tmp (or /var/lib/mysql/) can persist. When mysqld starts and finds this leftover socket file, it may interpret it as evidence of a running instance and fail to properly initialize, which can manifest as a TCP/IP binding error during startup. The fix is to manually delete the stale mysql.sock file and then restart the service.
Why the distractors are wrong:
- A is plausible-sounding but wrong - a fresh reboot clears all running processes, so a duplicate MySQL instance is extremely unlikely unless it auto-started during boot and you then tried to start it again manually.
- B is fabricated - there is no concept of a "frozen network service process" that pauses TCP/IP reuse at the OS level like this.
- C is wrong - MySQL defaults to port 3306, not port 80, and you don't need to manually specify the port to start the server.
- D is wrong -
/etc/hostsentries affect hostname resolution, not TCP socket binding conflicts;127.0.0.1being "in use" generically is not a valid failure mode.
Memory tip: Think of the .sock file as a "ghost" - MySQL sees it after a reboot and believes another server is haunting the port. When MySQL crashes, always clean up the ghost (rm /tmp/mysql.sock) before restarting.
Topics
Community Discussion
No community discussion yet for this question.