在MySQL 5.7中,这个查询运行得很好:
SHOW TABLE STATUS WHERE Rows > 0在MySQL 8.022中,它会产生以下错误:
#1064 - 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 'Rows > 0' at line 1在其他状态列上查询似乎没有问题:
SHOW TABLE STATUS WHERE Data_length > 0
SHOW TABLE STATUS WHERE Avg_row_length > 0 ..。诸若此类。
这是此版本MySQL的已知问题吗?
发布于 2021-04-13 03:11:03
https://dev.mysql.com/doc/refman/8.0/en/keywords.html#keywords-8-0-detailed-R说;
ROWS (R); became reserved in 8.0.2由于Rows现在是一个保留关键字,因此需要加引号才能以这种方式使用;
SHOW TABLE STATUS WHERE `Rows` > 0https://stackoverflow.com/questions/67063927
复制相似问题