Closed RoyWilliams closed 5 months ago
For reference this test code works:
import mysql.connector
config = {
'user': 'dbtest',
'password': 'password',
'host': '127.0.0.1',
'database': 'dbtest',
'allow_local_infile': True
}
query = "LOAD DATA LOCAL INFILE '/var/lib/mysql/testing.txt' REPLACE INTO TABLE testing2 FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\n'"
cnx = mysql.connector.connect(**config)
cursor = cnx.cursor(buffered=True)
cursor.execute(query)
cursor.close()
cnx.commit()
There are two methods to transfer the local database from filter node to main database. See
pipeline/filter/filtercore.py
In many ways it would be better and cleaner to use the client, but it needs some work on access permissions,