I'm trying to connect to MySQL database but, I'm getting an error.
Code:
<?php
ini_set('mysql.connection_timeout',300);
ini_set('default_socket_timeout',300);
define('DB_SERVER', 'localhost:8080');
define('DB_USERNAME', 'root');
define('DB_PASSWORD', '');
define('DB_DATABASE', 'sib');
$db = mysqli_connect(DB_SERVER,DB_USERNAME,DB_PASSWORD,DB_DATABASE);
?>
Which gives me the error:
Warning: mysqli_connect(): MySQL server has gone away in C:\xampp\htdocs\SIB\connect.php on line 9
Warning: mysqli_connect(): Error while reading greeting packet. PID=10696 in C:\xampp\htdocs\SIB\connect.php on line 9
Warning: mysqli_connect(): (HY000/2006): MySQL server has gone away in C:\xampp\htdocs\SIB\connect.php on line 9
Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\SIB\connect.php on line 9