unix - Is it possible to set MySQL session variables using mysqlimport? -
unix - Is it possible to set MySQL session variables using mysqlimport? -
i have import job uses unix's mysqlimport, , source info undependable, need set sql_mode="no_engine_substitution" job doesn't fail if there error. i'd prefer individual job, don't know if it's possible. know?
current command:
mysqlimport --compress --fields-terminated-by="," --fields-optionally-enclosed-by='"' --lines-terminated-by="\n" --replace --local --user=username --password=password -h localhost dbname company_data.txt
i'm not familiar mysqlimport, manual doesn't list alternative that.
since mysqlimport command-line interface load info infile sql statement, workaround this:
mysql -uuser -ppassword dbname -e "set session sql_mode='no_engine_substitution'; load info infile 'company_data.txt' ..." /*you can figure out rest*/
here's manual entry load info infile
.
mysql unix mysqlimport
Comments
Post a Comment