1、mysql默認的導入大小是:768M,當超過時,會報錯如下:
There was error(s) while executing the queries .
The query and the error message has been logged at:
C:\Users\Administrator\AppData\Roaming\SQLyog\sqlyog.err.
Please click on "Open Error File..." to open the error file.
如果可以申請權限,可直接調大mysql配置文件my.ini中的max_allowed_packet參數
可參考https://blog.csdn.net/IT_NQR/article/details/77772296
2、查看庫內所有表的數據量M:dbName代表庫名
SELECT
TABLE_NAME
,round((DATA_LENGTH/1024/1024),2) 'DATA_SIZE(M)'
,round((INDEX_LENGTH/1024/1024),2) 'INDEX_SIZE(M)'
,AVG_ROW_LENGTH
,MAX_DATA_LENGTH
,CREATE_TIME
FROM information_schema.tables
WHERE TABLE_SCHEMA ='dbName'
ORDER BY 2 desc;
3、清空所有表數據:(其實是生產truncate語句,然後執行)
(1)SELECT CONCAT('truncate table ',TABLE_NAME,';') AS a FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'dbName' ;
(2)得到所有表後,複製,粘貼、執行
4、刪除所有表:(包括表結構)
(1)SELECT concat('DROP TABLE IF EXISTS ', table_name, ';')FROM information_schema.tables
WHERE table_schema = 'dbName';
(2)得到所有表後,複製,粘貼、執行
註明:參考了好幾個博客,就不一一列舉了