MySQl 8.0 连接数据库出现以下错误

1
The user specified as a definer (‘mysql.infoschema‘@‘localhost‘) does not exist

解决办法:

  1. 重新创建该用户(mysql.infoschema)
1
create user 'mysql.infoschema' @ '%' identified by 'password';
  1. 给用户赋予权限
1
grant all privileges on *.* to 'mysql.infoschema'@'%';
  1. 刷新数据库
1
flush privileges;