I've been installing a MySQL database on my computer (just for fun, or whatever ^^). I've noticed that if you try to connect to it with any username but with no password it still accepts the connection, whether the username exists or not. Can this be prevented in some way?
Another thing I noticed is if you try to connect to it (through PHP's mysql_connect() ) and supply a username with an invalid password you get an error message saying somethign about "Access denied for user" but it STILL connects to the database and does its query. Obviously some setting must be wrong but every setup instructions I've read mentions nothing about it.
I know this aint a MySQL forum, but I don't know of any good ones.
"testuser" with the password "testpass" is a valid one. If I change the password to something else I get the error message in the generated file, but the query is still done in the database. Why can it still connect even with an invalid password?
mysql_connect("localhost", $user, $password);
@mysql_select_db($database) or die( "Unable to select database");
$query= " ... "; //Some query, not important
I'm sure it's something in the settings of the server. Look through the settings/readme files for the server. And you might want to post this over on www.flashdaddee.com/forums because [EMOBA] usually runs around over there and most likely will know the answer. He's pretty keen on this stuff.
check out this:
You need to specify a host and a user combination, the user you are using doesn't have a matching host.