We are moving a production site to EC2/RDS
Followed these instructions:
http://geehwan.posterous.com/moving-a-production-mysql-database-to-amazon
I have set up row-based binary logging on the production server
did a:
mysqldump –single-transaction –master-data=2 -C -q
-u root -p > backup.sql
then imported to RDS instance. No dramas.
Due to the size of the db, and minimal downtime requirements, I've got to update the ec2 db to the latest datas via the binlogs, and it won't let me.
mysqlbinlog mysql-bin.000004 –start-position=360812488 | mysql -uroot
-p -h
and it says:
ERROR 1227 (42000) at line 6: Access denied; you need (at least one
of) the SUPER privilege(s) for this operation
My guess, based on what is on line 6 of the binlog, is that it's the 'write to the BINLOG' statements in the SQL backup, and because RDS doesn't support this, it can't run these statements, or something, I don't really know.
Please help.
Best Answer
Most likely this is happening because
mysqlbinlog
writesBINLOG
command as the first command to the output, and execution of that command requiresSUPER
privileges that you don't have on RDS.To drop that command use
--base64-output=NEVER
option (note, it'll require also--read-from-remote-server --host=localhost --user username --password
).However after you overcome this problem, there's likely to another one, this time with
@@session
commands thatmysqlbinlog
writes to the output. They also requireSUPER
privileges.I haven't found a better way that to use
sed -i '/SET @@session/d' binlog_dump.sql
to remove them and then execute import into MySQL.