diff options
-rwxr-xr-x | bin/hidden-import.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/hidden-import.sh b/bin/hidden-import.sh new file mode 100755 index 0000000..ecd9f27 --- /dev/null +++ b/bin/hidden-import.sh @@ -0,0 +1,9 @@ +#!/bin/bash +DBCONFIG=($(jq -r '.[]' config/import-db.json)) +mysql -h ${DBCONFIG[2]} -P ${DBCONFIG[3]} -u ${DBCONFIG[0]} --password=${DBCONFIG[1]} -e "SET foreign_key_checks = 0; +DELETE FROM hidden_players; +LOAD DATA LOCAL INFILE '$1' +INTO TABLE hidden_players +FIELDS TERMINATED BY ';' ENCLOSED BY '\"'; +SET foreign_key_checks = 1 +" ${DBCONFIG[4]} |