summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/database/drivers/mysqli/mysqli_driver.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php
index 898f80e37..d16c98a68 100644
--- a/system/database/drivers/mysqli/mysqli_driver.php
+++ b/system/database/drivers/mysqli/mysqli_driver.php
@@ -125,6 +125,10 @@ class CI_DB_mysqli_driver extends CI_DB {
$client_flags = ($this->compress === TRUE) ? MYSQLI_CLIENT_COMPRESS : 0;
$mysqli = mysqli_init();
+ $mysqli->options(MYSQLI_OPT_CONNECT_TIMEOUT, 10);
+ $mysqli->options(MYSQLI_OPT_READ_TIMEOUT, 5);
+ $mysqli->options(MYSQLI_OPT_RECONNECT, 1);
+
if ($this->stricton)
{
$mysqli->options(MYSQLI_INIT_COMMAND, 'SET SESSION sql_mode="STRICT_ALL_TABLES"');