PATH="$bindir:$PATH"
db_name=@db_name@
-mysql ${db_name} -e "select VersionId from Version\G" >/tmp/$$
+mysql $* -D ${db_name} -e "select VersionId from Version\G" >/tmp/$$
DBVERSION=`sed -n -e 's/^VersionId: \(.*\)$/\1/p' /tmp/$$`
if [ $DBVERSION != 12 ] ; then
echo " "
PATH="$bindir:$PATH"
db_name=@db_name@
-DBVERSION=`psql ${db_name} -t --pset format=unaligned -c "select VersionId from Version"`
+DBVERSION=`psql -d ${db_name} -t --pset format=unaligned -c "select VersionId from Version" $*`
if [ $DBVERSION != 12 ] ; then
echo " "
echo "The existing database is version $DBVERSION !!"
PATH="$bindir:$PATH"
db_name=@db_name@
-mysql ${db_name} -e "select VersionId from Version\G" >/tmp/$$
+mysql $* -D ${db_name} -e "select VersionId from Version\G" >/tmp/$$
DBVERSION=`sed -n -e 's/^VersionId: \(.*\)$/\1/p' /tmp/$$`
if [ $DBVERSION != 11 ] ; then
echo " "
PATH="$bindir:$PATH"
db_name=@db_name@
-DBVERSION=`psql ${db_name} -t --pset format=unaligned -c "select VersionId from Version"`
+DBVERSION=`psql -d ${db_name} -t --pset format=unaligned -c "select VersionId from Version" $*`
if [ $DBVERSION != 11 ] ; then
echo " "
echo "The existing database is version $DBVERSION !!"