mysql - How to import a 10GB file to MySQL?
问题描述
"I am trying to import a backup file to MySQL. The file is 10GB but the problem I get an error when the backup reach the limit of max_allowed_packet which is: 1GB. Any idea how can I increase this number to 10GB ?"
I've tried to use this command:
mysql -u username -p database_name < file.sql
But i get the same error
I expect that i have to change the max_allowed_packet and net_buffer_length but how could i do that ?
Thank you!
解决方案
通过mysql命令行客户端设置max_allowed_packet和net_buffer_length
set global net_buffer_length=10000000;
set global max_allowed_packet=10000000000;
推荐阅读
- javascript - 有没有办法在同一个 for 循环中检查 1 个 json 文件中的 3 个数组?
- pip - 获取 pip pystruct==0.3.2 在 python=3.7 下构建
- ipad - 如何使用回调 URL 将草稿内容发送到 makeslides
- python - 哪个 R /Python 包用于分段分段回归和自动断点检测
- python - 为什么我在 python 中的掷骰子模拟器中的两个函数得到不同的结果?
- c++ - 书中“右值”和“右值引用”之间的混淆
- javascript - 在 Google Apps Script Web 应用程序中动态添加 Materialize 选择输入时出错
- javascript - 在鼠标移动时发送 Ajaxt 请求
- azure - Azure cosmosDB 中的子查询和 GroupBy
- vue.js - 如何通过使用 vuetify 单击按钮来更改背景颜色?