Skip to content

Commit 2ce5290

Browse files
committed
fixed database disk space calculation
1 parent b58c696 commit 2ce5290

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

func/db.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ get_mysql_disk_usage() {
509509
fi
510510

511511
query="SELECT SUM( data_length + index_length ) / 1024 / 1024 \"Size\"
512-
FROM information_schema.TABLES WHERE table_schema=\`$database\`"
512+
FROM information_schema.TABLES WHERE table_schema='$database'"
513513
usage=$(mysql -h $HOST -u $USER -p$PASSWORD -P $PORT -e "$query" |tail -n1)
514514
if [ "$usage" == 'NULL' ] || [ "${usage:0:1}" -eq '0' ]; then
515515
usage=1

0 commit comments

Comments
 (0)