Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kymtwyf/b497e7adf623bd5dc97032c3a11708e7 to your computer and use it in GitHub Desktop.
Save kymtwyf/b497e7adf623bd5dc97032c3a11708e7 to your computer and use it in GitHub Desktop.
阿里云Aliyun Access denied; you need (at least one of) the SUPER privilege(s) for this operation.md

Aliyun Reference 按照他提供的方法:

  1. 去掉DEFINER=root@`% 类似的子句
sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/ ' your.sql > your_revised.sql
  1. 检查 SQL 文件,去除下面类似的语句
SET @@GLOBAL.GTID_PURGED='d0502171-3e23-11e4-9d65-d89d672af420:1-373,
d5deee4e-3e23-11e4-9d65-d89d672a9530:1-616234';

运行

awk '{ if (index($0,"GTID_PURGED")) { getline; while (length($0) > 0) { getline; } } else { print $0 } }' your.sql | grep -iv 'set @@' > your_revised.sql

但是,还是有问题

所以我直接用sublime text find All 然后多行操作了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment