Last active
August 29, 2015 14:05
-
-
Save zhangskills/2b526a00898f618ab354 to your computer and use it in GitHub Desktop.
mysql相关
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 |
查看Mysql数据库大小
-
进入information_schema 数据库(存放了其他的数据库的信息)
use information_schema;
-
查询所有数据的大小:
select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables;
-
查看指定数据库的大小:
`select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='库名';
-
查看指定数据库的某个表的大小:
select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='库名' and table_name='表名';
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
允许远程访问:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY '123456' WITH GRANT OPTION;
FLUSH PRIVILEGES