因此,我尝试将sql文件导入rds(1G MEM,1 CPU)。sql文件就像1.4G
mysql -h xxxx.rds.amazonaws.com -u用户-ppass --max-allowed-packet = 33554432 db <db.sql
它停留在:
ERROR 1227 (42000) at line 374: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
实际的sql内容为:
/*!50003 CREATE*/ /*!50017 DEFINER=`another_user`@`1.2.3.4`*/ /*!50003 TRIGGER `change_log_BINS` BEFORE INSERT ON `change_log` FOR EACH ROW
IF (NEW.created_at IS NULL OR NEW.created_at = '00-00-00 00:00:00' OR NEW.created_at = '') THEN
SET NEW.created_at = NOW();
END IF */;;
another_user
在rds中不存在,所以我这样做:
GRANT ALL PRIVILEGES ON db.* TO another_user@'localhost';
仍然没有运气。
DEFINER
登录用户不具有SUPER
特权(RDS本身不允许该特权),则将允许任意特权升级-存储程序以其凭据和特权运行DEFINER
(而不是主叫用户的-INVOKER
)。同样在服务器故障时。