Tuesday, May 27, 2014

Thursday, May 22, 2014

LOAD DATA LOCAL INFILE does not work correctly on RDS replicated mysql

You'll get stuck in a with an error similar to:
Error 'Access denied for user ''@'' (using password: NO)' on query. Default database: 'asdf'. Query: 'LOAD DATA INFILE '/rdsdbdata/tmp/SQL_LOAD-2065609985-756826296-2.data'
The reason this breaks is essentially because the read replica is replaying the binary logs and when it gets to your LOAD DATA LOCAL INFILE statement, it doesn't have that file.

RDS Creates a brand new read replica from an existing database by using a snapshot, not by replaying the bin logs.
CALL mysql.rds_skip_repl_error; will correct the error but not the problem.