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导一遍 。 
  • 相关阅读:
    JS的运行机制
    Vue路由
    javascript的逼格
    Vue开发中遇到的问题及解决方案
    模块模式
    2019年终总结
    http知识总结
    小议函数的节流和防抖
    nodejs初探一二
    Object是个什么鬼
  • 原文地址:https://www.cnblogs.com/abclife/p/11038750.html
Copyright © 2011-2022 走看看