I want connect to MySQL on server, but the server only can be access with SSH. I use phpseclib to connect with SSH. And it was successfull. But when try connect to MySQL it said : Access Denied. So, I have these code. Anyone please help me..
<?php
//data for connection to SSH
//host : 10.81.229.31
//user : root
//pass : abcde
//here's data for connection to MySQL
//host = 10.81.229.31
//username = root
//password = abcde
//database name = testing
include('Net/SSH2.php');
//connecting to server with SSH
$ssh = new Net_SSH2('10.81.229.31');
if (!$ssh->login('root', 'abcde')) {
exit('Login Failed');
}else{
echo "Login Success";
}
//connecting to MySQL
echo $ssh->exec('mysql -h 10.81.229.31 -u root -p testing');
?>