SQL导入大CSV,内存不足错误 [英] SQL Importing Large CSV, Out of Memory Error
问题描述
我正在尝试将大型(65mb)CSV文件导入到SQL表中.我正在使用phpMyAdming和xampp.我已经更改了php.ini中的以下设置:
I am trying to import a large (65mb) CSV file into a SQL table. I am using phpMyAdming and xampp. I have changed the following settings in php.ini:
memory_limit = 6000M
post_max_size = 128M
upload_max_filesize = 128M
当我尝试此操作时,出现错误致命错误:第294行的C:\ xampp \ phpMyAdmin \ libraries \ import.lib.php中内存不足(已分配1852047360)(试图分配262145字节)"
When I try this I get error 'Fatal error: Out of memory (allocated 1852047360) (tried to allocate 262145 bytes) in C:\xampp\phpMyAdmin\libraries\import.lib.php on line 294'
我该怎么做才能解决此错误?我也想导入更大的数据库.
What can I do to solve this error? I would also like to import a much larger database as well.
推荐答案
您可以编写Python/PHP/Ruby脚本来读取文件并解析数据,并逐行运行INSERT语句.
You could write a Python/PHP/Ruby script to read the file and parse the data, and run INSERT statements row by row.
这篇关于SQL导入大CSV,内存不足错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!