Skip to main content

When I have seen things like this before it has been related to replication filtering. If there is any dbdatabase or table level filtering - on the master or slave - it is necessary to "use"select the appropriate DB with use before running any commands you wish to replicate. Try something like:

#!/bin/bash

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

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

When I have seen things like this before it has been related to replication filtering. If there is any db or table level filtering - on the master or slave - it is necessary to "use" the appropriate DB before running any commands you wish to replicate. Try something like:

#!/bin/bash

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

When I have seen things like this before it has been related to replication filtering. If there is any database or table level filtering - on the master or slave - it is necessary to select the appropriate DB with use before running any commands you wish to replicate. Try something like:

#!/bin/bash

mysql -udb_user -pdb_password -e "use db_name; LOAD DATA LOCAL INFILE '/srv/some_file.csv'
  INTO TABLE db_name.db_table FIELDS TERMINATED BY ','  LINES TERMINATED BY '\n'  
  (\`col1\`,\`col2\`,\`col3\`);"
Source Link
malonso
  • 161
  • 2
  • 5

When I have seen things like this before it has been related to replication filtering. If there is any db or table level filtering - on the master or slave - it is necessary to "use" the appropriate DB before running any commands you wish to replicate. Try something like:

#!/bin/bash

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