MySQL/Amazon RDS 错误:“您没有 SUPER 权限...";

我正在尝试将我的 mysql 数据库从 Amazon EC2 复制到 RDS:

I'm attempting to copy my mysql database from an Amazon EC2 to an RDS:

我使用这个成功地将我的数据库的 mysqldump 放到了我的根文件夹中:

I successfully did a mysqldump of my database into my root folder using this:

root@ip-xx-xx-xx-xx:~# mysqldump my_database -u my_username -p > my_database.sql

然后我尝试将此 .sql 文件传输到我的新 RDS 数据库:

Then I tried to transfer this .sql file to my new RDS database:

root@ip-xx-xx-xx-xx:~# mysql my_database -u my_username -p -h  
my_new_database.xxxxxxxxx.us-east-1.rds.amazonaws.com < my_database.sql

很遗憾,我收到以下错误消息:

Unfortunately, I get following error message:

You do not have the SUPER privilege and binary logging is enabled 
(you *might* want to use  the less safe log_bin_trust_function_creators variable)

我尝试以多种方式GRANT SUPER..,但是当我尝试这样做时也遇到了错误.输入 mysql >FLUSH 特权; 也不起作用.

I tried to GRANT SUPER.. in a variety of ways but I'm getting errors when I try to do that too. Typing mysql > FLUSH privileges; doesn't work either.

我是 mysql 初学者,很抱歉问这么简单的问题.想法?

I'm a mysql beginner so sorry for such an easy question. Thoughts?

推荐答案

Per http://getasysadmin.com/2011/06/amazon-rds-super-privileges/,你需要在log_bin_trust_function_creators设置为1.com/rds/">AWS 控制台,加载您的转储文件而不会出错.

Per http://getasysadmin.com/2011/06/amazon-rds-super-privileges/, you need to set log_bin_trust_function_creators to 1 in AWS console, to load your dump file without errors.

如果您想忽略这些错误,并加载转储文件的其余部分,您可以使用 -f 选项:

If you want to ignore these errors, and load the rest of the dump file, you can use the -f option:

mysql -f my_database -u my_username -p -h  
my_new_database.xxxxxxxxx.us-east-1.rds.amazonaws.com < my_database.sql

-f 将报告错误,但会继续处理转储文件的其余部分.

The -f will report errors, but will continue processing the remainder of the dump file.

相关文章