目前我正在尝试通过 phpMyAdmin 将 1.3 GB CSV 导入 MySQL。
问题: 很难分割文件然后导入它,使用 Windows 程序分割后,某些列会损坏。
问题: 是否可以将整个内容上传到 phpMyAdmin 而无需拆分它?
信息 我在 phpMyAdmin 中有 5 列,CSV 也是如此,因此各列匹配。
最佳答案
其他 user 可能也面临此类问题还有。
按照他的回答,就可以使用了。
mysql -u root -p
set global net_buffer_length=1000000; --Set network buffer length to a large byte number
set global max_allowed_packet=1000000000; --Set maximum allowed packet size to a large byte number
SET foreign_key_checks = 0; --Disable foreign key checking to avoid delays,errors and unwanted behaviour
source file.sql --Import your sql dump file
SET foreign_key_checks = 1; --Remember to enable foreign key checks when procedure is complete!
另请查看另一种方法
mysql -u username -p -h hostname databasename < dump.sql
关于php - CSV 大文件分割以导入 phpMyAdmin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42112375/