inconsistent mysqladmin return value, debian init-script dependency
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
5.1 |
Won't Fix
|
Undecided
|
Unassigned | |||
5.5 |
Expired
|
Undecided
|
Unassigned | |||
5.6 |
Expired
|
Undecided
|
Unassigned | |||
5.7 |
Expired
|
Undecided
|
Unassigned |
Bug Description
One (or two) minor bug(s) that I arbritrary hit on because someone had overwritten /etc/mysql/
This doesn't quite make sense:
$ mysqladmin -u foo -pbar ping
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'foo'@'localhost' (using password: YES)'
$ echo $?
0
At the other hand:
$ mysqladmin --defaults-
Could not open required defaults file: /foo/bar
Fatal error in defaults handling. Program aborted
$ echo $?
1
The init-script is checking weather mysql is running or not by doing ...
mysqladmin --defaults-
This means mysql is always regarded as running if the password in /etc/mysql/
$ cat /etc/issue
Ubuntu 14.04.1 LTS \n \l
root@glimmer:~# aptitude show percona-
Package: percona-
(...)
Version: 5.5.39-
description: | updated |
Changed in percona-server: | |
assignee: | nobody → Muhammad Irfan (muhammad-irfan) |
Changed in percona-server: | |
assignee: | Muhammad Irfan (muhammad-irfan) → nobody |
I am able to verify with latest Percona Server 5.5 version.
root@testnode: /etc/mysql# lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 14.04.1 LTS
Release: 14.04
Codename: trusty
mysql> show global variables like '%version%'; ------- ------- -----+- ------- ------- ------- ------- ------- ------- ------- + ------- ------- -----+- ------- ------- ------- ------- ------- ------- ------- + conversions | | compile_ machine | x86_64 | ------- ------- -----+- ------- ------- ------- ------- ------- ------- ------- +
+------
| Variable_name | Value |
+------
| innodb_version | 5.5.40-36.1 |
| protocol_version | 10 |
| slave_type_
| version | 5.5.40-36.1 |
| version_comment | Percona Server (GPL), Release 36.1, Revision 707 |
| version_
| version_compile_os | debian-linux-gnu |
+------
root@testnode:~# mysqladmin --user=root --password=xxxx ping
mysqld is alive
root@testnode:~# echo $?
0
Exit status is zero which is correct, but below when i used the wrong credentials exit status is still zero instead of non-zero.
root@testnode:~# mysqladmin --user=foo --password=bar ping
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'foo'@'localhost' (using password: YES)'
root@testnode:~# echo $?
0