I have this server running LightHTTPD. I am trying access MySQL/PHPMyAdmin on this server. So far i have googled too much and tried so many things. I did this recently, edited this file /etc/mysql/my.conf
, add bind-address = ip of my server;
, then i did this:
mysql -u root -p
mysql> GRANT ALL ON databasename.* TO root@'0.0.0.0' IDENTIFIED BY 'pasword';
Now when i tried to connect to that server from IP i have granted, it gives me this error:
ini_set('display_errors',1);
error_reporting(E_ALL);
define("DB_NAME","pun_update");
define("DB_USER","root");
define("DB_PASS","");
define ("DB_SERVER","ip of my server");
function connect()
{
$db_handle = mysql_connect(DB_SERVER,DB_USER,DB_PASS)
or die("Unable to Connect to Database check your settings");
mysql_select_db(DB_NAME,$db_handle) or die ("Database doesnot exist");
}
connect();
I get this errror:
Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 110
Instead of using the IP try using the actual url of the remote server. Check this previous question.
According to this page, error 110
is a connection timeout.
The MySQL site (MySQL server has gone away) cites instances which may cause this problem (you should check them out). Here is a notable one (for your case):
Another networking issue that can cause this error occurs if the MySQL port (default 3306) is blocked by your firewall, thus preventing any connections at all to the MySQL server.
There is another question (Lost connection...) which might be related to your problem if this is the cause.
Otherwise check that you are really connecting with the correct parameters. If possible try on the server itself.
Hope this helps!