Fixed some errors on multiple MySQL installations.
This commit is contained in:
@@ -256,39 +256,6 @@ declare -i index_arr=0
|
||||
if [[ -n "$mysql_credential_args" ]]; then
|
||||
MYSQL_CREDENTIAL_ARGS="$mysql_credential_args"
|
||||
MYSQL_CREDENTIALS_GIVEN=true
|
||||
else
|
||||
|
||||
detect_mysql_version
|
||||
|
||||
MAJOR_VERSION="$MYSQL_MAJOR_VERSION"
|
||||
MINOR_VERSION="$MYSQL_MINOR_VERSION"
|
||||
PATCH_LEVEL="$MYSQL_PATCH_LEVEL"
|
||||
|
||||
if [[ "$MYSQL_CUR_DISTRIBUTION" = "MariaDB" ]] && ([[ $MAJOR_VERSION -gt 10 ]] \
|
||||
|| ( [[ $MAJOR_VERSION -eq 10 ]] && [[ $MINOR_VERSION -gt 3 ]] )) ; then
|
||||
if [[ -S "/tmp/mysql.sock" ]]; then
|
||||
MYSQL_CREDENTIAL_ARGS="-u root -S /tmp/mysql.sock"
|
||||
elif [[ -S "/var/run/mysqld/mysqld.sock" ]]; then
|
||||
MYSQL_CREDENTIAL_ARGS="-u root -S /var/run/mysqld/mysqld.sock"
|
||||
else
|
||||
fatal "Parameter 'MYSQL_CREDENTIAL_ARGS' cannot be determined automated.
|
||||
|
||||
Use configuration file "$conf_file" to set
|
||||
parameter manually."
|
||||
fi
|
||||
else
|
||||
if [[ -f "/usr/local/mysql/sys-maint.cnf" ]] ; then
|
||||
MYSQL_CREDENTIAL_ARGS="--defaults-file=/usr/local/mysql/sys-maint.cnf"
|
||||
elif [[ -f "/etc/mysql/debian.cnf" ]] ; then
|
||||
MYSQL_CREDENTIAL_ARGS="--defaults-file=/etc/mysql/debian.cnf"
|
||||
else
|
||||
fatal "Parameter 'MYSQL_CREDENTIAL_ARGS' cannot be determined automated.
|
||||
|
||||
Use configuration file "$conf_file" to set
|
||||
parameter manually."
|
||||
fi
|
||||
fi
|
||||
MYSQL_CREDENTIALS_GIVEN=false
|
||||
fi
|
||||
|
||||
|
||||
@@ -339,6 +306,8 @@ if [[ ${#mysql_credential_args_arr[@]} -gt 0 ]] ; then
|
||||
fi
|
||||
done
|
||||
|
||||
MYSQL_CREDENTIALS_GIVEN=true
|
||||
|
||||
fi
|
||||
|
||||
if $DATABASE_NAME_NEEDED ; then
|
||||
@@ -396,6 +365,39 @@ if $MYSQL_CREDENTIALS_GIVEN ; then
|
||||
echo -e "\033[32m--\033[m"
|
||||
echo ""
|
||||
|
||||
else
|
||||
|
||||
detect_mysql_version
|
||||
|
||||
MAJOR_VERSION="$MYSQL_MAJOR_VERSION"
|
||||
MINOR_VERSION="$MYSQL_MINOR_VERSION"
|
||||
PATCH_LEVEL="$MYSQL_PATCH_LEVEL"
|
||||
|
||||
if [[ "$MYSQL_CUR_DISTRIBUTION" = "MariaDB" ]] && ([[ $MAJOR_VERSION -gt 10 ]] \
|
||||
|| ( [[ $MAJOR_VERSION -eq 10 ]] && [[ $MINOR_VERSION -gt 3 ]] )) ; then
|
||||
if [[ -S "/tmp/mysql.sock" ]]; then
|
||||
MYSQL_CREDENTIAL_ARGS="-u root -S /tmp/mysql.sock"
|
||||
elif [[ -S "/var/run/mysqld/mysqld.sock" ]]; then
|
||||
MYSQL_CREDENTIAL_ARGS="-u root -S /var/run/mysqld/mysqld.sock"
|
||||
else
|
||||
fatal "Parameter 'MYSQL_CREDENTIAL_ARGS' cannot be determined automated.
|
||||
|
||||
Use configuration file "$conf_file" to set
|
||||
parameter manually."
|
||||
fi
|
||||
else
|
||||
if [[ -f "/usr/local/mysql/sys-maint.cnf" ]] ; then
|
||||
MYSQL_CREDENTIAL_ARGS="--defaults-file=/usr/local/mysql/sys-maint.cnf"
|
||||
elif [[ -f "/etc/mysql/debian.cnf" ]] ; then
|
||||
MYSQL_CREDENTIAL_ARGS="--defaults-file=/etc/mysql/debian.cnf"
|
||||
else
|
||||
fatal "Parameter 'MYSQL_CREDENTIAL_ARGS' cannot be determined automated.
|
||||
|
||||
Use configuration file "$conf_file" to set
|
||||
parameter manually."
|
||||
fi
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user