I'm using PHP in order to connect to MySQL with the following way:
$link = mysql_connect('...host...', '...username...', '...password...');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
and it connects just fine. But when trying from my terminal this
mysql -h ...host... -u ....username... -p ...password...
I give my password and i take as a result this:
ERROR 2003 (HY000): Can't connect to MySQL server on '...host...' (111)
Any ideas how this can be solved?