Move optimize_mysql_tables.conf.sample mysql_credetials.conf.sample. Read configuration file by scripts 'optimize_mysql_tables.sh' 'flush_query_cache.sh' and 'flush_host_cache.sh'.
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
working_dir="$(dirname $(realpath $0))"
|
||||
conf_file="${working_dir}/conf/mysql_credetials.conf"
|
||||
|
||||
#LOGGING=true
|
||||
LOGGING=false
|
||||
|
||||
@@ -15,20 +18,19 @@ if [ -z "$mysqladmin" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
## - Since Version 5.6, that method is considered as insecure.
|
||||
## - To avoid giving the password on command line, we use an
|
||||
## - encrypted option file
|
||||
## -
|
||||
## - Create (encrypted) option file:
|
||||
## - $ mysql_config_editor set --login-path=local --socket=/var/run/mysqld/mysqld.sock --user=backup --password
|
||||
## - $ Password:
|
||||
## -
|
||||
## - Use of option file:
|
||||
## - $ mysql --login-path=local ...
|
||||
## -
|
||||
mysql_credential_args="--login-path=local"
|
||||
#mysql_user='sys-maint'
|
||||
#mysql_password='9A7NUgaJST1XiEUU'
|
||||
|
||||
#---------------------------------------
|
||||
#-----------------------------
|
||||
# Read Configurations from $conf_file
|
||||
#-----------------------------
|
||||
#---------------------------------------
|
||||
|
||||
if [[ -f "$conf_file" ]]; then
|
||||
source "$conf_file"
|
||||
fi
|
||||
|
||||
[[ -z "$mysql_credential_args" ]] && mysql_credential_args="--login-path=local"
|
||||
|
||||
|
||||
if $LOGGING ;then
|
||||
echo -e "\n[ `date` ] Going to flush host cache.."
|
||||
|
||||
Reference in New Issue
Block a user