当我运行以下查询时,我得到一个错误:

SELECT
  `a`.`sl_id`                     AS `sl_id`,
  `a`.`quote_id`                  AS `quote_id`,
  `a`.`sl_date`                   AS `sl_date`,
  `a`.`sl_type`                   AS `sl_type`,
  `a`.`sl_status`                 AS `sl_status`,
  `b`.`client_id`                 AS `client_id`,
  `b`.`business`                  AS `business`,
  `b`.`affaire_type`              AS `affaire_type`,
  `b`.`quotation_date`            AS `quotation_date`,
  `b`.`total_sale_price_with_tax` AS `total_sale_price_with_tax`,
  `b`.`STATUS`                    AS `status`,
  `b`.`customer_name`             AS `customer_name`
FROM `tbl_supplier_list` `a`
  LEFT JOIN `view_quotes` `b`
    ON (`b`.`quote_id` = `a`.`quote_id`)
LIMIT 0, 30

错误信息是:

#1449 - The user specified as a definer ('web2vi'@'%') does not exist

为什么会出现这个错误?我该怎么解决呢?


当前回答

对于未来的谷歌人:我收到了类似的消息,试图更新数据库中不包含视图的表。经过一番挖掘,我发现我在那个表上导入了触发器,而那些是由不存在的用户定义的东西。放下触发器就解决了问题。

其他回答

当mysql。Proc是空的,但是系统总是提示“user@192.168.%”的table_name不存在,你只需要在mysql命令行中输入root:

CHECK TABLE `database`.`table_name` QUICK FAST MEDIUM CHANGED;
flush privileges;

结束了!

通过运行以下注释修复。

grant all on *.* to 'web2vi'@'%' identified by 'root' with grant option;
FLUSH PRIVILEGES;

如果你得到的是some_other而不是web2vi,那么你必须相应地改变名称。

grant all on *.* to 'username'@'%' identified by 'password' with grant option;

例子:

grant all on *.* to 'web2vi'@'%' identified by 'password' with grant option;

如果用户存在,则:

mysql> flush privileges;

对我来说,从DEFINER中删除“是有效果的。 DEFINER = user@localhost