[SOLVED] How to set timeout of mysql connection lazarus / 16-Databases ---------------------------------------------------------------------- heejit · 2018-03-22 19:48 I am connecting to multiple mysql server to get some data if any server is not connected within 4 seconds function return error message and continue with next server I am using SQLDB setting params has no effect Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i      conn.DatabaseName := db_name;      conn.HostName := ip;      conn.UserName := user;      conn.Password := pwd;      conn.Connected := True;      conn.Params.Add('connect_timeout=4');      Result := conn;      writeln('connected to :' + ip); ---------------------------------------------------------------------- Huandi · 2018-06-19 20:16 You need to change 5 and 6 lines of the place.       conn.Params.Add('connect_timeout=4');       conn.Connected := True; ---------------------------------------------------------------------- heejit · 2018-06-20 19:35 Not working Connection still wait for default timeout ---------------------------------------------------------------------- heejit · 2018-06-30 15:53 Adding this solve the issue TMySQL57Connection.Params.Add('MYSQL_OPT_CONNECT_TIMEOUT=5');