We are having a very strange problem on our server.
Any user (including root), can't access mysql on local system, and it swaps between flushes.
We are using a simple php script to test it...
$username = "test";
$password = "pass123";
$conn = new mysqli("localhost", $username, $password);
if ($conn->connect_error) {echo "[localhost] Connection failed: " . $conn->connect_error;} else echo "[localhost] Connected successfully";
echo "<hr>";
$conn = new mysqli("127.0.0.1", $username, $password);
if ($conn->connect_error) {echo "[127.0.0.1] Connection failed: " . $conn->connect_error;} else echo "[127.0.0.1] Connected successfully";
echo "<hr>";
$conn = new mysqli("192.168.1.2", $username, $password);
if ($conn->connect_error) {echo "[192.168.1.2] Connection failed: " . $conn->connect_error;} else echo "[192.168.1.2] Connected successfully";
So let me step you through the sequence.
We can't get Coldfusion or PHP to maintain connections. It works at first, the first connection, when [email protected] (configured so in mysql), but subsequently fails in coldfusion, and php can't reliably connect depending on service restarts or flushes. PHP really outlines the problem, as seen above. But the JDBC connector for coldfusion just seems to randomly either work or not.
Any ideas what is happening here? user@% should always work, should it not?
Additional notes:
Found the answer, sorry guys, should have researched just a moment more. https://serverfault.com/questions/122472/allowing-wildcard-access-on-mysql-db-getting-error-access-denied-for-use
Sometimes we find the right keywords by talking about it, that rubber duck effect.
Basically, well, apparently, mysql by default includes a blank user record, with a host of localhost, which supersedes any user@%. Resulting in this behaviour. Delete the user, and problem solved. now my firewall can be turned back on... wow.
The IIS problems I mentioned are a topic for another day I suppose...