错误场景描述:
使用navicat远程msyql8,以及在服务器中连接上服务器以后show tables时报错,
ERROR 1449 (HY000): The user specified as a definer ('mysql.infoschema'@'localhost') does not exist
解决方式:
// 查询是否有这个账户
select user,host from mysql.user where user='mysql.infoschema';
// 查看这个账户的权限
show grants for 'mysql.infoschema'@'localhost';
// 删除这个mysql.infoschema
DROP USER 'mysql.infoschema'@'localhost';
// 创建mysql.infoschema
CREATE USER 'mysql.infoschema'@'localhost' IDENTIFIED BY 'password';
// 授权
GRANT SELECT ON *.* TO `mysql.infoschema`@`localhost`;