python - Getting an error while executing query on MySQL -


hello getting following error when doing following query, executing both queries @ same time:

create table if not exists some_data (event_index int, record_index int, device_index smallint, phone_id smallint, transaction_id smallint, probe_seq_count smallint, probe_seq_result text(100), duration_slots int, probe_pn smallint, probe_sector int, probe_color_code smallint, sum_probe_count int) engine = innodb;  load data local infile '/home/path/data.csv' table some_data fields terminated ',' enclosed '\"' lines terminated '\\n';" 

error: query upload error: (2014, "commands out of sync; can't run command now")

this code using, please help:

# connecto mysql server     self.connect()      if(_verbosity):         print('\tupload start')      # upload data     table in tableddl:         try:             self.cursor.execute(tableddl[table])             #self.conn.commit()             #results = self.cursor.fetchall()             #print(results)             break          except mysqldb.error err:             print('\terror: query upload error: %s' % err)             print('\t%s' % tableddl[table])             sys.exit(1)         except exception err:             print('error: %s' % err.message)             sys.exit(1)         except:             print('\terror: other error: %s' % (sys.exc_info()[0]))             sys.exit(1) 

the user under following privileges:

grant create, drop, insert, select, update, delete, lock tables on access.* 'some_user'@'localhost'; grant file on *.* 'some_user'@'localhost'; flush privileges; 

thank you!


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -