I am evaluating MySQL governor on a cloudlinux environment (CentOS and Cpanel are also installed) This is a test server so no actual database connections are running.
I want to be able to restrict the nr of database user connections.
I have set a limit in MySQL governor but I am unable to test it. I need some sort of script (php?) that can open up a bunch of MySQL connections to be able to see some result.
Here is a sample code I am trying to run, that is supposed to generate multiple connections, but it only opens one.
<?php
$servername = "localhost";
$username = "user";
$password = "pass";
$dbname = "db";
// Create connection
while(1) {
#$conn = new mysqli($servername, $username, $password, $dbname);
$conn = mysql_pconnect($servername, $username, $password);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
}
?>
Thanks