Manual:$wgSqlTimeout

Details
Timeout to kill the DB thread.