mysql 查询所有表的大小_Mysql 查询所有表的行数和大小

SELECT TABLE_NAME,TABLE_ROWS,DATA_LENGTH/1024/1024 "DATA_LENGTH",CREATE_TIME,TABLE_COLLATION FROM

INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'lir' ORDER BY TABLE_ROWS DESC

e82527520da658a0231428f73ef3afe4.png

[plain] view plaincopy[dss@localhost ~]$ mysql -u root -pEnter password:Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 36Server version: 5.6.16 MySQL Community Server (GPL)Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> show database;ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database' at line 1mysql> show databases;+--------------------+| Database           |+--------------------+| information_schema || fire               || hive               || lir                || mysql              || performance_schema || test               |+--------------------+7 rows in set (0.03 sec)mysql> use fire;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedmysql> load data infile 'aa.txt' into table firewallb;ERROR 13 (HY000): Can't get stat of '/var/lib/mysql/fire/aa.txt' (Errcode: 2 - No such file or directory)mysql> load data infile '/home/dss/aa.txt' into table firewallb;ERROR 13 (HY000): Can't get stat of '/home/dss/aa.txt' (Errcode: 13 - Permission denied)mysql> load data infile '/tmp/aa.txt' into table firewallb;Query OK, 10 rows affected (0.07 sec)Records: 10  Deleted: 0  Skipped: 0  Warnings: 0mysql> load data infile '/tmp/fireb.txt' into table firewallb;[plain] view plaincopyQuery OK, 16600931 rows affected (38 min 25.54 sec)Records: 16600931  Deleted: 0  Skipped: 0  Warnings: 0

导入数据文件到mysql

mysql导出数据到文件

SELECT * INTO OUTFILE '/tmp/bb.csv' FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n' FROM bb_month;

https://blog..net/wind520/article/details/38728655

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值