Bug #80795 mysqladmin hangs when executed during server startup
Submitted: 19 Mar 2016 0:23 Modified: 8 Jun 2018 10:02
Reporter: Fabian Gonzales Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.7.10 OS:MacOS (10.11.3)
Assigned to: CPU Architecture:Any
Tags: hangs, mysqladmin, startup

[19 Mar 2016 0:23] Fabian Gonzales
Description:
I am running into an issue where mysqladmin hangs when executed during server startup.

When executing "mysqladmin status" in a loop to determine when the database is ready after starting MySQL using "mysqld_safe", waiting for the process to exit with exit code 0, the mysqladmin command eventually hangs.

The command line is as follows:
     mysqladmin --protocol=TCP --port=3306 --user=root --password= --no-beep status

Output from mysqladmin when run in a loop during server startup:

...
...
...
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to MySQL server on 'localhost' (61)'
Check that mysqld is running on localhost and that the port is 3306.
You can check this by doing 'telnet localhost 3306'
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to MySQL server on 'localhost' (61)'
Check that mysqld is running on localhost and that the port is 3306.
You can check this by doing 'telnet localhost 3306'
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to MySQL server on 'localhost' (61)'
Check that mysqld is running on localhost and that the port is 3306.
You can check this by doing 'telnet localhost 3306'
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
160318 17:13:26 mysqld_safe Logging to '<...>/logs/error.log'.
160318 17:13:26 mysqld_safe Starting mysqld daemon with databases from <...>/data
[Process hangs here]

How to repeat:
1) Unpack MySQL 5.7.10 binaries
2) Run mysqld --initialize-insecure
3) Run the bash script below:

#!/bin/bash
echo "Starting MySQL"
bin/mysqld_safe --defaults-file=db.cnf &

connect="--protocol=TCP --host=localhost --port=3306 --user=root --password="

# Wait for the database to start up
bin/mysqladmin $connect status
while [ $? -ne 0 ]
do
  bin/mysqladmin $connect status
done
echo "MySQL started"
[8 May 2018 10:02] MySQL Verification Team
Sorry for to be late. Try version 5.7.22. Thanks.
[9 Jun 2018 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".