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

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -