zoukankan      html  css  js  c++  java
  • ERROR 1044 (42000): Access denied for user 'root'@'localhost' to database 'information_schema'

    在处理这个问题(https://www.cnblogs.com/abclife/p/11038660.html)的时候,开发同学在最后修改视图的definer的时候又遇到了以下的报错信息:

    ERROR 1044 (42000): Access denied for user 'root'@'localhost' to database 'information_schema'
    

     

    数据库版本是:mysql 5.7.25。让他执行以下操作:

    >select user();
    >select current_user() from dual;
    >select host,user from mysql.user where user='root';
    
    >show grants for root@'localhost';
    >show grants for root@'%';

    >select * from mysql.user where user='root';

      

    反馈说用户和权限都没啥问题,然后再次让其把执行报错的现象截图发过来:

    root@localhost:information_schema 11:16:24>alter definer=`root`@`%` view <view_name> as select  ...
    ERROR 1044 (42000): Access denied for user 'root'@'localhost' to database 'information_schema'
    

     

    可以看到,它是在information_schema数据库下执行,切换到视图真正所在的数据库再次执行命令就可以正确执行了。 

     因为information_schema是一个虚拟的数据库,里面的表其实都是视图。其实在导入数据的时候,也没有必要将information_schema导一遍 。 
  • 相关阅读:
    KVC
    MRC&ARC
    网络基础
    沙盒
    GCD深入了解
    iOS 架构模式MVVM
    iOS 源代码管理工具之SVN
    iOS给UIimage添加圆角的两种方式
    Objective-C 中,atomic原子性一定是安全的吗?
    iOS Block循环引用
  • 原文地址:https://www.cnblogs.com/abclife/p/11038750.html
Copyright © 2011-2022 走看看