Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (19.1k points)

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

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

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 the 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)

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.

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

1 Answer

0 votes
by (44.4k points)

you would have to set log_bin_trust_function_creators to 1 in AWS console, to load your dump file without errors.

To load your dump file without any errors, set log_bin_trust_function_creators to 1 in AWS console

You can also ignore the errors by using the -f option to load the rest of the dump file

mysql -f my_database -u my_username -p -h  

my_new_db.xxxxxxxxx.us-east-1.rds.amazonaws.com < my_database.sql

Even if there are errors, -f will report it and will continue processing the rest of the dump file

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...