mysql 如何查看视图

mysql 如何查看视图,第1张

1) mysql>show table status where comment='view'

(说明:Mysql5.1支持视图,视图被看作一种抽象表,因此显示视图状态的语句与显示表状态的语句相同,只是在comment列中以‘view’区分)

2) mysql>select * from information_schema.tables where table_schema='yourDatabaseName' and table_type='view'

(说明:这种方法通过系统表查找,效果同上,显示信息更详细。如果不能正确显示结果,可能是大小写的问题,Mysql在不同系统平台不同配置参数下的显示结果可能不同,注意这点。)

1、DTS数据同步报错

2、源端用户user1拥有所有database的权限,包括select权限

3、使用user1用户登录源端MySQL,当指定database为database1,select被拒绝

4、从MySQL的物理表文件看,表的.frm和.ibd文件是正常的

5、将报错的表table1备份为table2,删除table1,select information_schema.columns、information_schema.tables可执行且不报错

6、将table2重命名为table1,select information_schema.columns、information_schema.tables再次报一样的错误

7、将table1重命名为table2,select information_schema.columns、information_schema.tables可执行且不报错

8、原因判断

参考: https://bugs.mysql.com/bug.php?id=63527

其他用户也遇到了与MySQL对象相关的information_schema.columns、information_schema.tables的select报错,但是涉及的MySQL对象为view,而我们这里为table。

view可以指定definer等,而table1的创建语法中没有找到这样的字眼。但是推测以某一种方式与definer相关联。

9、辅证


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/6098232.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-14
下一篇 2023-03-14

发表评论

登录后才能评论

评论列表(0条)

保存