Connect to MySQL Server via fsockopen

wxdqz

New Member
Hey,

does anybody know, wheter I can talk to an MySQL in the same way, as I can to a eg. SMTP server with fsockopen() like this:

$f=fsockopen("mysql.server",3306,&$erno, &$errstr);
echo fgets($f,512);
fputs($f, "ANY COMMAND\n");
echo fgets($f,512);
fclose($f);

after the first fgets, the server answers with its version number.
But how can I get some usefull data out of it, and how can I log in at all?
When opening the socket, the processlist shows:
User: unauthenticated user
Host: myIP
Command: connect
State: login

This shows, that there must be a way to connect!

Thanks for any advice!

tom
 
Back
Top