diff --git a/correct-cloud-database-row-format.sh b/correct-cloud-database-row-format.sh new file mode 100755 index 0000000..37e7e9d --- /dev/null +++ b/correct-cloud-database-row-format.sh @@ -0,0 +1,14 @@ +#"/usr/bin/env bash + +read -p "Enter Database Name: " DB_NAME + +echo + +mysql -e " +SELECT CONCAT('ALTER TABLE \`', TABLE_NAME, '\` ROW_FORMAT=DYNAMIC;') +FROM INFORMATION_SCHEMA.TABLES +WHERE TABLE_SCHEMA = '$DB_NAME' +AND ENGINE = 'InnoDB'; +" -B -N | while read -r sql; do + mysql -e "$sql" "$DB_NAME" +done