summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2021-05-09 19:06:44 +0200
committeremkael <emkael@tlen.pl>2021-05-09 19:06:44 +0200
commit745d173a1d038e63983e9f0e015bb6551262f307 (patch)
treea5da80b61750112fde4b3b71d583935dd8ddeb4c
parent4d425f5012edeb9dc8bc2bba16445681672623f4 (diff)
Enable local-infile in mysql imports
-rwxr-xr-xbin/cezar-db-import.sh2
-rwxr-xr-xbin/rankings-csv-import.sh2
2 files changed, 2 insertions, 2 deletions
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