0

I am working on converting unix time to readable time.
It is necessary to insert a 6gb .txt file into my database
(XAMPP V3.2.2 , MYSQL workbench 5.2.34).
I have written the SQL query to convert unix time but whenever i run the query, Mysql workbench will crash
(error:2013.lost connection to database during query.).why?

my SQL query:UPDATE database.database SET readable_time=from_unixtime(unix_time);

Minzkraut
  • 2,149
  • 25
  • 31
A.peleng
  • 9
  • 2

2 Answers2

0

Increasing net_read_timeout solves this problem

From doc: Sometimes the “during query” form happens when millions of rows are being sent as part of one or more queries. If you know that this is happening, you should try increasing net_read_timeout from its default of 30 seconds to 60 seconds or longer, sufficient for the data transfer to complete.

Click here for more info.

Please check this post - Error Code: 2013. Lost connection to MySQL server during query

Community
  • 1
  • 1
Sandy
  • 1,043
  • 2
  • 21
  • 32
0

As you are talking about an insert, understand that the 'Workbench' loses the connection, but the query continues to execute in the 'server'. That is, the workbench can no longer update you on the status changes for that query execution. But, the execution of the query keeps continuing behind screens.

You might want to run show processlist to see if the insert process is still running or not.

However, while fetching data from the database, you might have to update your timeout settings.

Sarath Chandra
  • 1,850
  • 19
  • 40