From cd815ee66f3ee07f58a8b29c85e99bca8c86f19f Mon Sep 17 00:00:00 2001 From: Christoph Date: Wed, 2 Aug 2023 16:06:15 +0200 Subject: [PATCH] Add support vor unix socket located at /run/mysqld folder. --- drop_database.sh | 2 ++ drop_database_user.sh | 2 ++ drop_tables.sh | 2 ++ grant_backup_privileges_to_user.sh | 2 ++ grant_dbaccess_to_user.sh | 2 ++ grant_full_access_to_user.sh | 2 ++ repair_mysql_tables.sh | 2 ++ 7 files changed, 14 insertions(+) diff --git a/drop_database.sh b/drop_database.sh index 6f75b0a..46b6dfc 100755 --- a/drop_database.sh +++ b/drop_database.sh @@ -508,6 +508,8 @@ else || ( [[ $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 "/run/mysqld/mysqld.sock" ]]; then + MYSQL_CREDENTIAL_ARGS="-u root -S /run/mysqld/mysqld.sock" elif [[ -S "/var/run/mysqld/mysqld.sock" ]]; then MYSQL_CREDENTIAL_ARGS="-u root -S /var/run/mysqld/mysqld.sock" else diff --git a/drop_database_user.sh b/drop_database_user.sh index bcee3f2..8e2703e 100755 --- a/drop_database_user.sh +++ b/drop_database_user.sh @@ -470,6 +470,8 @@ else || ( [[ $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 "/run/mysqld/mysqld.sock" ]]; then + MYSQL_CREDENTIAL_ARGS="-u root -S /run/mysqld/mysqld.sock" elif [[ -S "/var/run/mysqld/mysqld.sock" ]]; then MYSQL_CREDENTIAL_ARGS="-u root -S /var/run/mysqld/mysqld.sock" else diff --git a/drop_tables.sh b/drop_tables.sh index 96c8b09..d724797 100755 --- a/drop_tables.sh +++ b/drop_tables.sh @@ -399,6 +399,8 @@ else || ( [[ $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 "/run/mysqld/mysqld.sock" ]]; then + MYSQL_CREDENTIAL_ARGS="-u root -S /run/mysqld/mysqld.sock" elif [[ -S "/var/run/mysqld/mysqld.sock" ]]; then MYSQL_CREDENTIAL_ARGS="-u root -S /var/run/mysqld/mysqld.sock" else diff --git a/grant_backup_privileges_to_user.sh b/grant_backup_privileges_to_user.sh index 97bc818..bac91db 100755 --- a/grant_backup_privileges_to_user.sh +++ b/grant_backup_privileges_to_user.sh @@ -483,6 +483,8 @@ else || ( [[ $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 "/run/mysqld/mysqld.sock" ]]; then + mysql_credential_args="-u root -S /run/mysqld/mysqld.sock" elif [[ -S "/var/run/mysqld/mysqld.sock" ]]; then MYSQL_CREDENTIAL_ARGS="-u root -S /var/run/mysqld/mysqld.sock" else diff --git a/grant_dbaccess_to_user.sh b/grant_dbaccess_to_user.sh index 52b9560..4588b71 100755 --- a/grant_dbaccess_to_user.sh +++ b/grant_dbaccess_to_user.sh @@ -556,6 +556,8 @@ else || ( [[ $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 "/run/mysqld/mysqld.sock" ]]; then + mysql_credential_args="-u root -S /run/mysqld/mysqld.sock" elif [[ -S "/var/run/mysqld/mysqld.sock" ]]; then MYSQL_CREDENTIAL_ARGS="-u root -S /var/run/mysqld/mysqld.sock" else diff --git a/grant_full_access_to_user.sh b/grant_full_access_to_user.sh index fdc1f1e..2442b62 100755 --- a/grant_full_access_to_user.sh +++ b/grant_full_access_to_user.sh @@ -477,6 +477,8 @@ else || ( [[ $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 "/run/mysqld/mysqld.sock" ]]; then + mysql_credential_args="-u root -S /run/mysqld/mysqld.sock" elif [[ -S "/var/run/mysqld/mysqld.sock" ]]; then MYSQL_CREDENTIAL_ARGS="-u root -S /var/run/mysqld/mysqld.sock" else diff --git a/repair_mysql_tables.sh b/repair_mysql_tables.sh index e5ed02d..42216f3 100755 --- a/repair_mysql_tables.sh +++ b/repair_mysql_tables.sh @@ -377,6 +377,8 @@ else || ( [[ $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 "/run/mysqld/mysqld.sock" ]]; then + mysql_credential_args="-u root -S /run/mysqld/mysqld.sock" elif [[ -S "/var/run/mysqld/mysqld.sock" ]]; then MYSQL_CREDENTIAL_ARGS="-u root -S /var/run/mysqld/mysqld.sock" else