Mysql Error:The user specified as a definer ('mysql.infoschema'@'localhost') does not exist' when trying to dump tablespaces

后端 未结 3 636
耶瑟儿~
耶瑟儿~ 2021-01-30 06:54

After I upgraded MySQL 5.7 to MySQL 8.0, I started MySQL again and I got an error:The user specified as a definer (\'mysql.infoschema\'@\'localhost\') does not exist\' when tryi

3条回答
  •  失恋的感觉
    2021-01-30 07:26

    In my case, such error was caused by that I had changed the host of the dba user from % to localhost to strengthen the security.

    I used "abcdba" with DDL right to create db schema, and used "abc" with CURD right for the Web service to use the DB. After the change, the read operations were OK but the write operations failed with the error message in the OP.

    Flush privilege or restarting the server did not solve the problem. Then I changed to host of the dba user back to %. Then things have become normal again.

    Apparently mysql does not like the changes of host of the dba user, and existing databases created by that dba user will have problem if the host of the dba user is changed.

    Essentially, changing the host of the dba user is actually removing user abcdba@% and creating a new user abcdba@localhost. Here had come the error message, since abcdba@% and abcdba@localhost are 2 differently fully qualified usernames.

提交回复
热议问题