Ive got to import 1go of sql data, i raised up the max_allowed_packet to 1100M to be sure.
So i use :
My query
mysql -u root -p -D mainbase < GeoPC_WO.sql
But 1 minute later it stops during the process and i get this error :
**ERROR 2013 (HY000) at line 23: Lost connection to MySQL server during query
**Lost connection to MySQL server during query****
Open the MySQL Workbench Preferences. Check if the SSH Timeout and DBMS Timeout value is set to only a few seconds. Try to increase the default value of the connection timeouts. Save the settings, close the MySQL Workbench and reopen the connection to see if you are able to connect to the database.
The error above commonly happens when you run a long or complex MySQL query that runs for more than a few seconds. To fix the error, you may need to change the timeout-related global settings in your MySQL database server.
Can I adjust the timeout? Yes, go to Preferences, SQL Editor, and adjust the DBMS connection read time out option that defaults to 600 seconds. This sets the maximum amount of time (in seconds) that a query can take before MySQL Workbench disconnects from the MySQL server.
Possible that you have some large insert statements that are bigger than you max size. Check your /etc/mysql/my.cnf file or wherever it is. Cannot remember what the default is - but setting it to something large like below may help.
This is one option
[mysqld]
max_allowed_packet = 16M
And maybe the other way
[mysqldump]
max_allowed_packet = 16M
I had exactly the same problem. After 1 hour of struggling I resolved this by setting
net_write_timeout
to a higher value (in my situation it's 300)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With