日常使用转至GitHub个人博客,有兴趣的朋友可移步 我的小站
查询mysql所有库中所有包含某一字段的表
select * from information_schema.columns where column_name='[字段名]';
查询mysql具体库中包含某一字段的表
select * from information_schema.columns where table_schema='[数据库名]' and column_name='[字段名]';
查询mysql中数据库有哪些表
select table_name from information_schema.tables where table_schema='[数据库名]';
查询数据库隔离级别
show variables like 'transaction_isolation'
查找持续时间超过60s的事务
select * from information_schema.innodb_trx where TIME_TO_SEC(timediff(now(), trx_started)) > 60