kea-admin / admin-utils.sh ignores the -h --host arg for the database (GH#104)
<This issue was opened on Github as issue #104 (closed) by Kroki0815 on Sept 20, 2018>
If the mysql-database is not on localhost, upgrade of the database with kea-admin is not possible.
i looked into the code and the problem is in the admin-utils.sh:
mysql_execute() {
QUERY=$1
shift
if [ $# -gt 1 ]; then
mysql -N -B "$@" -e "${QUERY}"
retcode=$?
else
mysql -N -B --database="${db_name}" --user="${db_user}" --password="${db_password}" -e "${QUERY}"
retcode=$?
fi
return $retcode
}
mysql_execute_script() {
file=$1
shift
if [ $# -ge 1 ]; then
mysql -N -B "$@" < "${file}"
retcode=$?
else
mysql -N -B --database="${db_name}" --user="${db_user}" --password="${db_password}" < "${file}"
retcode=$?
fi
return $retcode
}
The mysql lines should look like this:
mysql -N -B --host="${db_host}" --database="${db_name}" --user="${db_user}" --password="${db_password}"
This problem may be also in the other backends.
This bug is in all versions, also in the master-branch.