MySQL查询数据库中没有主键的表

发布时间:2020-08-11 19:46:30 作者:壹頁書
来源:ITPUB博客 阅读:498

  1. select table_schema,table_name from information_schema.tables
  2. where (table_schema,table_name) not in(
  3.     select distinct table_schema,table_name from information_schema.columns where COLUMN_KEY='PRI'    
  4. )
  5. and table_schema not in (
  6.     'sys','mysql','information_schema','performance_schema'
  7. );

推荐阅读:
  1. mysql无法删除表中的主键
  2. 脚本找出mysql中缺少主键的表

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

mysql 中没 数据库

上一篇:知识点 | 4个缓解Slack安全风险的技巧

下一篇:一个RESOURCE MANAGER引起的问题分析

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》