#!/bin/bash
mkdir -p /home/mysql/opdir/zfy/jisuan
for port in `seq 3100 3126`
do
/home/mysql/mysql_${port}/bin/mysql --defaults-file=/home/mysql/mysql_${port}/etc/user.root.cnf -e "select TABLe_SCHEMA as data_name,concat(round(sum(DATA_LENGTH/1024/1024), 2), 'MB') as data_size from information_schema.tables group by TABLe_SCHEMA;" >> /home/mysql/opdir/zfy/jisuan/${port}.sql
done
echo good job!
按照实例进入数据库打印所有的库信息
最新推荐文章于 2022-01-05 09:00:00 发布