错误代码:1044。拒绝用户 'root'@'%' 访问数据库 'xxxxxxxABC'

Error Code: 1044. Access denied for user 'root'@'%' to database 'xxxxxxxABC'

我想在 Mysql 中创建以下时间表。它显示错误:“错误代码:1044。拒绝用户 'root'@'%' 访问数据库 'xxxxxABC'

CREATE EVENT resetAccount
ON SCHEDULE EVERY 1 HOUR
STARTS CURRENT_TIMESTAMP
DO 
 UPDATE user_master SET AccountNonLocked = 1 WHERE AccountNonLocked = 0  
       and username in 
                    (select username from  user_attempts  where last_modified between          DATE_SUB(now(),INTERVAL 24 HOUR) and DATE_SUB(now(),INTERVAL 23 HOUR)
                    );

我检查了之前 Whosebug 评论中提到的所有可能的解决方案。 我还检查了用户的权限和 运行 也遵循命令。 “SELECT 主机,用户,密码,Grant_priv,Super_priv 来自 mysql.user;”

显示如下输出 enter image description here

还有我运行"SELECT USER(),CURRENT_USER();" 输出: enter image description here

现在,为什么我会收到此错误,因为用户拥有所有权限。

尝试执行此操作:

echo "SET PASSWORD FOR root@localhost=PASSWORD('password');" > /var/lib/mysql/rootpwd.sql
service mysql restart
rm -f /var/lib/mysql/rootpwd.sql

或尝试授予权限

UPDATE mysql.user SET Grant_priv='Y', Super_priv='Y' WHERE User='root';
FLUSH PRIVILEGES;
GRANT ALL ON *.* TO 'root'@'localhost';