I'm trying to see all the tables from an external MySQL server. I've its IP address, username, password to connect & query their database. But when I try to query to show all the tables I get error message like this,
Warning: mysql_connect(): A connection attempt failed because the connected party did not properly
respond after a period of time, or established connection failed because connected host has failed
to respond. in G:\XAMPP\htdocs\test.php on line 2
Failed to connect to MySQL: Access denied for user ''@'localhost' to database 'thedb'
Here is my code,
<?php
$conn = mysql_connect("202.82.31.11", "abc_user", "abc123");
$select = mysql_select_db("thedb");
if(!$conn || !$select){
echo "Failed to connect to MySQL: " . mysql_error();
}
$sql = "SHOW TABLES";
$result=mysql_query($sql);
echo $result;
?>
I was told to always connect from real IP 52.247.181.57. So what does it mean? Do I've to connect from my real IP? If so, how can I do that? I need to know the procedures. Your help would be much appreciated. Tnx. FYI, the IP here are all dummy/random IP for example purpose.