sfu-db / connector-x

Fastest library to load data from DB to DataFrames in Rust and Python
https://sfu-db.github.io/connector-x
MIT License
1.93k stars 151 forks source link

How to set timeout for MySQL #512

Open akbarnotopb opened 1 year ago

akbarnotopb commented 1 year ago

Try Discussion?

Halo, as the title stated, how to set custom mysql timeout? Im having error when my source database is slow . The error said connection timeout, yet i can't find any parameter to set it. Do i set it inside the connection uri ? or what?

Thanks in advance.

evbo commented 6 months ago

It just causes connectorx to hang indefinitely If I use the timeout URI query parameter. For instance:

f"mysql://{u}:{p}@{h}:{p}?connect-timeout=500"

more here: https://dev.mysql.com/doc/refman/8.0/en/connecting-using-uri-or-key-value-pairs.html

So how else should we set a timeout?