Should I change mysql.connect_timeout variable in php.ini?
I have definitely altered this variable for upgrades, but my notes show I only increased the values to 1800.

I don't recall whether this was because I found that -1 didn't work, or because I preferred to not allow a connection to remain open indefinitely.

So yes, I think you should alter it if necessary to complete upgrade.

If you find setting to -1 works, make sure to change it back post-upgrade!