日常使用转至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
本文分享了MySQL数据库的实用查询技巧,包括如何查找特定字段所在的表、查看数据库隔离级别、定位长时间运行的事务等,适用于数据库管理员及开发者。
8万+

被折叠的 条评论
为什么被折叠?



