Closed void285 closed 2 years ago
About the mysql related error, FYI https://stackoverflow.com/questions/1884859/lost-connection-to-mysql-server-during-query
The mysql docs have a whole page dedicated to this error: http://dev.mysql.com/doc/refman/5.0/en/gone-away.html
of note are
You can also get these errors if you send a query to the server that is incorrect or too large. If mysqld receives a packet that is too large or out of order, it assumes that something has gone wrong with the client and closes the connection. If you need big queries (for example, if you are working with big BLOB columns), you can increase the query limit by setting the server's max_allowed_packet variable, which has a default value of 1MB. You may also need to increase the maximum packet size on the client end. More information on setting the packet size is given in Section B.5.2.10, “Packet too large”.
You can get more information about the lost connections by starting mysqld with the --log-warnings=2 option. This logs some of the disconnected errors in the hostname.err file
Sounds good to me. Mind submitting a PR?
I just encountered with a mysql related error, and find error printing in base.py may obstruct debugging when the sql is very long, so I change it like this:
I tried to insert 100 records in one batch, the sql it very long, in this case about 5M, to solve the problem, I have to reduce the amount the records in a batch, this is a mysql related issue, maybe not due to pymedoo.
The error I got is as below, print the whole sql is terrible, so I modify
base.py
to print the slim version: