init script test db with wrong credential

Bug #1439673 reported by emilio brambilla
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC
Status tracked in 5.6
5.5
Confirmed
Undecided
Raghavendra D Prabhu
5.6
Fix Released
Undecided
Raghavendra D Prabhu

Bug Description

on percona-xtradb-cluster-server-5.6 /etc/init.d/mysql init script the db status test has hardcoded username and password:

mysql -u root -pabcd -e 'select 1;' 2>&1 | grep 'ERROR 2002'

I know it is not necessary to have a working account to check for "ERROR 2002" (cannot connect), but this abcd password is very dirty and logs a warning on mysql logs: "Access denied for user 'root'@'localhost' (using password: YES)"

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

Yes, it can be replaced with mysqladmin ping (which should work even with wrong creds).

Revision history for this message
Nilnandan Joshi (nilnandan-joshi) wrote :

Confirmed with PXC 5.5.41 and 5.6.22. It seems, this issue is only with deb packages.

mysqld_status () {
    mysqld_pid=$(cat $pid_file 2>/dev/null)

    if [ ! $mysqld_pid ];then
        echo "MySQL PID not found, pid_file detected/guessed: $pid_file" | $ERR_LOGGER
        if [ "$1" = "check_dead" ]; then
            return 0
        fi
        return 1
    fi

    ping_alive=1
    ps_alive=0

    soutput=$(mysql -u root -pabcd -e 'select 1;' 2>&1 | grep 'ERROR 2002')
    [ "$soutput" ] && ping_alive=0

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXC-1815

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.