MySQL 8 错误:Error Code: 1044 - Access denied for user 'root'@'%' to database 'information_schema' 解决方法
这个错误是因为MySQL用户'root'@'%'没有访问数据库'information_schema'的权限。'information_schema'是MySQL系统数据库,存储有关数据库和表的元数据信息。\n\n要解决这个问题,你可以尝试以下几种方法:\n\n1. 授予用户'root'@'%'访问'information_schema'数据库的权限。在MySQL命令行中执行以下命令:\n \n GRANT ALL PRIVILEGES ON `information_schema`.* TO 'root'@'%';\n FLUSH PRIVILEGES;\n \n\n2. 如果你不需要在SQL脚本中操作'information_schema'数据库,可以在执行脚本时使用--skip-information-schema参数来跳过该数据库:\n \n mysql -u root -p --skip-information-schema < your_script.sql\n \n\n3. 检查你的SQL脚本,确保没有试图在'information_schema'数据库中执行操作。\n\n请注意,直接将MySQL的root用户暴露在公共网络中是不安全的,建议使用更安全的方式连接数据库。
原文地址: https://www.cveoy.top/t/topic/qg5c 著作权归作者所有。请勿转载和采集!