Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: Navicat导入SQL到TIDB提示lost connection to server during query
[TiDB Usage Environment] Production Environment
[TiDB Version] 7.1.0
[Reproduction Path] Using Navicat to import a SQL file with 100,000 records, it prompts “lost connection to server during query”
[Encountered Issue: Import prompts “lost connection to server during query”]
[Resource Configuration]
Did the KV resources run out and cause a restart?
The prompt you mentioned indicates that TiDB is out of memory. Please share the architecture diagram of your machine.
The disk should not meet the standard.
The max_allowed_packet setting is probably too low.
Hmm, it feels like the disk is a cloud disk.
Is there a commit among these 100,000 SQL statements? Is it committed once every 1,000 lines?
Can you check the database logs?
I wrote my own program specifically to address the issue of low execution efficiency for large file SQL.
No, the disk had an issue and couldn’t write, so it was restarted. Then, another TiKV was started. It was taken offline yesterday, but it still shows as offline.
The disk was tested before and basically met the standards. It is an SSD, but it might be a cloud disk.
Using Navicat’s data synchronization feature, it commits once per transaction.
Cloud storage might be slow, but it shouldn’t throw errors. Try setting those three parameters as I suggested, and then process the SQL again to see if it works.
I think you need to understand what a cloud disk is. Many cloud disks have poor performance.
Many cloud providers now offer SSD fast disks.
Did the service restart? Or was it shut down?
Is there a problem with this value?