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

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

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


当前回答

遵循以下步骤:

进入PHPMyAdmin 选择数据库 选择您的表格 在顶部菜单中点击“触发器” 点击“编辑”编辑触发器 将定义器从[user@localhost]更改为root@localhost

希望能有所帮助

其他回答

解决方案只是一个单行查询如下:

grant all on *.* to 'ROOT'@'%' identified by 'PASSWORD' with grant option;

将ROOT替换为mysql用户名。 将PASSWORD替换为mysql密码。

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

用户web2vi在你的mysql服务器上不存在。

看到http://dev.mysql.com/doc/refman/5.1/en/error-messages-server.html error_er_no_such_user

如果该用户确实存在,检查它可以从哪些服务器访问,尽管我认为这将是一个不同的错误(例如,您可能有web2vi@localhost,但您正在以web2vi@%(在任何地方)访问数据库)

这种情况发生在我用MYSQL Workbench 6.3 Community在Windows 10上导入转储文件后,提示“root@%不存在”。即使用户存在。 首先,我试图注释掉DEFINER,但是,这没有工作。 然后,我用“root@localhost”替换了“root@%”上的字符串,并重新导入转储。这招对我很管用。

你可以试试这个:

$ mysql -u root -p 
> grant all privileges on *.* to `root`@`%` identified by 'password'; 
> flush privileges;