要获取MySQL数据库中表的尺寸,可以使用“information_schema.tables”。以下是了解所有表尺寸的语法:SELECT TABLE_NAME AS `ALLTABLESNAME`, ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024) AS `TABLESIZEIN(MB)` FROM information_schema.TABLES WHERE TABLE_SCHEMA = "yourDatabaseName" ORDER BY (DATA_LENGTH + INDEX_LENGTH) ASC;让我们应用上述语法来获取表的尺寸。mysql> SELECT TABLE_NAME AS `ALLTABLESNAME`, ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024) AS `TABLESIZEIN(MB)` -> FROM information_schema.TABLES WHERE TABLE_SCHEMA = "business" ... 阅读更多
您可以在MySQL中启用ONLY_FULL_GROUP_BY,如下面的查询所示:mysql> SET sql_mode = 'ONLY_FULL_GROUP_BY'; 如上所示,我们可以使用SET命令启用ONLY_FULL_GROUP_BY。要使用以下查询禁用ONLY_FULL_GROUP_BY:mysql> SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY','')); 我们已成功禁用ONLY_FULL_GROUP_BY。