0

enter image description hereI have the following code written in python, id is an auto increment field and the data type for sample is nvarchar(45). I want to insert the content of the file into my table; the data is unstructured:

db = MySQLdb.connect("localhost", "root", "Mydatabases#0", "myblog")
cursor = db.cursor()
cursor.execute("insert into mytable (id,sample) values (DEFAULT ,LOAD_FILE('C:/Discharge_Summary/sample_648.txt'))")
db.commit()
db.close()

I do not see any error, but when I select * from my table, I see null for sample field!!! why it cannot load the file content into MySql?

The screenshot shows that I have all required permissions...

nina_dev
  • 625
  • 2
  • 10
  • 19
  • Possible duplicate of [Load\_File doesn't work](https://stackoverflow.com/questions/8229951/load-file-doesnt-work) – Moob May 26 '18 at 20:50
  • @Moob thank you, I have attached a screen shot of MySql account setting, showing that I have the required permission, also, the text files are within the same machine that MySql is running, what are other possibilities that leads to having null input in MySql? – nina_dev May 26 '18 at 21:22

0 Answers0