I’m getting a MemoryError when I try to read a large sql file in Python3.6 with this command:
with open(sql_file, ‘r’) as f:
Is there an alternative to this so I can correctly read my sql file ?
I’m getting a MemoryError when I try to read a large sql file in Python3.6 with this command:
with open(sql_file, ‘r’) as f:
Is there an alternative to this so I can correctly read my sql file ?
If you have the sql file you should import it into a database and than use a library like MySQLdb for python to make your database requests.
I would guess, that opening sql files directly is a good solution. If you want to work with files, I think csv files are the better solution.