创建DEFINER =`root` @`%`EVENT,如果不是EXISTS

时间:2014-09-15 09:20:46

标签: mysql scheduler privileges

每当我尝试在mysql 5.5.23上安排一个新事件时,

我收到以下错误:

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

我已经检查了root帐户的权限:

"GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, 
       REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, 
       LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, 
       SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER ON *.* TO 'root'@'%' 
       IDENTIFIED BY PASSWORD '*xxxxxxxxxxxxxxxxxxxxxxxxxxxxx' WITH GRANT OPTION".

感谢您的帮助!

1 个答案:

答案 0 :(得分:0)

正如@wchiquito在对问题的评论中指出的那样:

  

您似乎没有被授予特权活动

这可以通过以下方式轻松解决:

GRANT EVENT ON *.* TO 'root'@'%' 
   IDENTIFIED BY PASSWORD '*xxxxxxxxxxxxxxxxxxxxxxxxxxxxx' 
   WITH GRANT OPTION;
FLUSH PRIVILEGES;

注意:在您的问题中,您引用了用户'root'@'%'。但是,在对问题的评论中,您谈到了'root'@'localhost'。在MySQL中,这些是不同的实体。