当前位置:Gxlcms > 数据库问题 > 脚本找出mysql中缺少主键的表

脚本找出mysql中缺少主键的表

时间:2021-07-01 10:21:17 帮助过:27人阅读

$MYSQL_CMD information_schema 2>/dev/null -NBe "select distinct TABLE_SCHEMA,table_name from columns where  TABLE_SCHEMA = ‘$db‘ and table_name not in ( select distinct table_name from COLUMNS  where TABLE_SCHEMA = ‘$db‘ and (column_key  = ‘PRI‘ or column_key = ‘UNI‘) )" | tee -a $LOG

done



本文出自 “菜鸡” 博客,请务必保留此出处http://lee90.blog.51cto.com/10414478/1932495

脚本找出mysql中缺少主键的表

标签:找出没有主键的表

人气教程排行