<?php
$timeout = 3;
echo "Testing connection to 127.0.0.1:3306...\n";
$link = mysqli_init();
$link->options(MYSQLI_OPT_CONNECT_TIMEOUT, $timeout);
$success = @$link->real_connect("127.0.0.1", "root", "", "swagvio", 3306);
if ($success) {
    echo "SUCCESS: Connected to MySQL. Database found.\n";
    $link->close();
} else {
    echo "FAILED: " . mysqli_connect_error() . "\n";
}
?>
