Getting error in DBeaver mysql when try to import large sql database file

Viewed 15733
    C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql.exe --host=localhost --port=3306 -u root nd7b265_rahetbally
Task 'MySQL script' started at Sun May 31 09:53:09 MST 2020
ERROR 2013 (HY000) at line 118827: Lost connection to MySQL server during query
Task 'MySQL script' finished at Sun May 31 09:53:13 MST 2020
2020-05-31 09:53:13.363 - IO error: Process failed (exit code = 1). See error log.
2020-05-31 09:53:13.363 - java.io.IOException: Process failed (exit code = 1). See error log.
    at org.jkiss.dbeaver.tasks.nativetool.AbstractNativeToolHandler.executeProcess(AbstractNativeToolHandler.java:182)
    at org.jkiss.dbeaver.tasks.nativetool.AbstractNativeToolHandler.doExecute(AbstractNativeToolHandler.java:237)
    at org.jkiss.dbeaver.tasks.nativetool.AbstractNativeToolHandler.lambda$0(AbstractNativeToolHandler.java:52)
    at org.jkiss.dbeaver.runtime.RunnableContextDelegate.lambda$0(RunnableContextDelegate.java:39)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
4 Answers

Just change connection setting from --host=localhost to --host=127.0.0.1.

It works for me.

Via right click DB > SQL editor > New SQL script

Execute following queries:

set global net_buffer_length=1000000; 
set global max_allowed_packet=1000000000;

https://stackoverflow.com/a/18979736

At mysql client program, you can config the maxallowedpacket as below. enter image description here

At the mysql server, max_allowed_package is in mysqld.conf (mysql 5.7 version)

enter image description here

If database size is bigger 7GB, you have to make a trick with 256MB as the post https://stackoverflow.com/a/35599592

I solved it by adding these lines

wait_timeout = 28800 interactive_timeout = 28800 max_allowed_packet=100M

under [mysql] section

Related