From 745d173a1d038e63983e9f0e015bb6551262f307 Mon Sep 17 00:00:00 2001 From: emkael Date: Sun, 9 May 2021 19:06:44 +0200 Subject: Enable local-infile in mysql imports --- bin/cezar-db-import.sh | 2 +- bin/rankings-csv-import.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/cezar-db-import.sh b/bin/cezar-db-import.sh index 4db5261..c91eeaf 100755 --- a/bin/cezar-db-import.sh +++ b/bin/cezar-db-import.sh @@ -1,6 +1,6 @@ #!/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; +mysql --local-infile=1 -h ${DBCONFIG[2]} -P ${DBCONFIG[3]} -u ${DBCONFIG[0]} --password=${DBCONFIG[1]} -e "SET foreign_key_checks = 0; LOAD DATA LOCAL INFILE '$1' REPLACE INTO TABLE players diff --git a/bin/rankings-csv-import.sh b/bin/rankings-csv-import.sh index 9eddd82..cf6ec06 100755 --- a/bin/rankings-csv-import.sh +++ b/bin/rankings-csv-import.sh @@ -1,6 +1,6 @@ #!/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; +mysql --local-infile=1 -h ${DBCONFIG[2]} -P ${DBCONFIG[3]} -u ${DBCONFIG[0]} --password=${DBCONFIG[1]} -e "SET foreign_key_checks = 0; DELETE FROM temp_rankings; LOAD DATA LOCAL INFILE '$1' REPLACE -- cgit v1.2.3