Skip to content Skip to sidebar Skip to footer

Can't Connect To Mysql Server On 'ipaddress' (110)

So I have a PHP file hosted on Namecheap server. $db=mysql_connect ('ipaddress', 'user', 'pass') or die ('I cannot connect to the database because: ' . mysql_error()); and it g

Solution 1:

I have experienced this issue. What I did was use the internet address instead of your public IP/DNS.

Since, I'm using Linux I do ifconfig and you will see inet addr: xxx.xxx.xxx.xxx and use that IP as your host instead of the public IP/DNS. On Windows, Simply use your local IP address.

That's it!

Solution 2:

If you are using MySQL for your database solution (which seems odd due to the usage of IIS on a Windows Server operating system)

Try running (As Root):

GRANT ALL ON Database.* TO Username@'IPAddress' IDENTIFIED BY 'PASSWORD';

Where the second is the permissions that you are granting on, this is a place holder forall

This will allow a connection from the IP you specify

also A problem is with connecting to your MySQL engine from inside your network, you will naturally connect from an internal IPV4 Address (192.168.0.x for example) this does not require portforwarding. BUT if you are using:

mysql_connect('WANIP', 'User', 'password'); you will have to forward port 3306 to your server. http://www.portforward.com for assistance.

Edit:

http://dev.mysql.com/doc/refman/5.0/en/can-not-connect-to-server.html

The manual for this subject, this may provide some assistance


If you are using Microsoft SQL Server check this link out:

http://blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx

Solution 3:

I have faced this issue when installing opencart on my server. When i was using Windows server it requires IP address of website/domain. Now when shifted to linux hosting, linux hosting accpted as localhost And done. I could install opencart

Post a Comment for "Can't Connect To Mysql Server On 'ipaddress' (110)"