Tell me more ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have a shell script that looks something like that:

 #!/bin/bash
 mysql -udb_user -pdb_password -e "LOAD DATA LOCAL INFILE '/srv/some_file.csv'
 INTO TABLE db_name.db_table FIELDS TERMINATED BY ','  LINES TERMINATED BY '\n'  
(\`col1\`,\`col2\`,\`col3\`);"

the problem is that when I run this script on my master server the call doesnt get replicated to the slave server (even though /srv/some_file.csv exists on both servers).

any ideas how to make shell command replicate over servers?

share|improve this question
possible duplicate of MySql shell command not replicated to slave – Derek Downey Jan 16 '12 at 16:36
i voted the other one as duplication, it had a problem with identifying me as the author.... – Ran Jan 16 '12 at 16:41
@DTest BTW, following our disscussion from the other question, my version of mysql should support the load data and when i run it from the mysql shell it works and being replicated, but when i run from the linux shell it only works on the master and not on the slave – Ran Jan 16 '12 at 16:45
I am assuming when you run it through the -e flag, that it actually makes the changes on the master server? – Derek Downey Jan 16 '12 at 18:13
yes, when using running with the -e flag the changes are made on the master but dont get replicated to the slave. if i the same query on a mysql shell, data is affected on the master and the slave – Ran Jan 16 '12 at 21:05

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.