-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
Dear,
I would like to use pymysql with sqlachemy (python3) to load a local file. Thus I execute this statement:
metadata = Base.metadata
SessionMaker = sessionmaker(bind=engine)
session = SessionMaker()
query = "LOAD DATA LOCAL INFILE {} INTO TABLE Sequence_String FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n'".format( SS_file_name )
session.execute( query )
session.flush()
But an error is raised:
sqlalchemy.exc.ProgrammingError: (pymysql.err.ProgrammingError) (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tmp_file_SS_table.txt INTO TABLE Sequence_String FIELDS TERMINATED BY '\t' LINES ' at line 1") [SQL: "LOAD DATA LOCAL INFILE tmp_file_SS_table.txt INTO TABLE Sequence_String FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n'"]
I tried with another engine mysqldb instead of pymysql and works as expected.
Any help are welcome
Metadata
Metadata
Assignees
Labels
No labels