[MDEV-18861] mysqladmin ping -u root -pmypassword returns successfully, even if the login fails Created: 2019-03-08 Updated: 2019-03-10 Resolved: 2019-03-10 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Documentation, Scripts & Clients |
| Affects Version/s: | 10.4.3 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | Michael Hinkel | Assignee: | Ian Gilfillan |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
official MariaDB docker image mariadb:10.4.3 |
||
| Description |
|
I wanted to use mysqladmin ping to perform a livenesscheck. I'm using the root user with an assigned password, thus the command:
If login fails, the command writes an error message to the error stream - but the return value of the failed function is "0" although it should be "1" ($? retrieves the return value of the last executed command). |
| Comments |
| Comment by Elena Stepanova [ 2019-03-09 ] |
|
Since the purpose of the pinging is to check whether the server is alive, doesn't it actually help your cause that it returns 0 when it's alive, no matter whether you can actually connect with these credentials or not? |
| Comment by Michael Hinkel [ 2019-03-09 ] |
|
hmmm... this sounds like a reasonable argument. I didn't see it that way, but you're right: the server is alive and that's what a ping should check - not whether or not a user can successfully log in... Thanks! |
| Comment by Elena Stepanova [ 2019-03-09 ] |
|
It's intentional legacy behavior (and documented explicitly in MySQL manual). I think it's worth mentioning in the KB. |
| Comment by Ian Gilfillan [ 2019-03-10 ] |