From 6b1b9e58a6d40b805b3dd4e8e7d8095911dc7eec Mon Sep 17 00:00:00 2001 From: Ruslan Baidan Date: Mon, 1 Mar 2021 12:08:45 +0100 Subject: [PATCH] Added the script to fix the clients anrs table limit. --- scripts/fix_clients_dbs.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 scripts/fix_clients_dbs.sh diff --git a/scripts/fix_clients_dbs.sh b/scripts/fix_clients_dbs.sh new file mode 100644 index 0000000..a79317f --- /dev/null +++ b/scripts/fix_clients_dbs.sh @@ -0,0 +1,10 @@ +#! /usr/bin/env bash + +for conf_file in /var/www/*/local.php +do + db_user=$(grep 'user' $conf_file | head -1 | sed "s/'user' => '//" | sed "s/',//" | sed 's/^[ \t]*//;s/[ \t]*$//') + db_pwd=$(grep 'password' $conf_file | head -1 | sed "s/'password' => '//" | sed "s/',//" | sed 's/^[ \t]*//;s/[ \t]*$//') + echo "Alter anrs table raw size for $db_user ..." + mysql -u $db_user -p$db_pwd $db_user -e "ALTER TABLE anrs ROW_FORMAT=DYNAMIC;" + echo "Done." +done