I am getting error while i configure remote database in phpMyadmin.
error is like as below
#2002 - 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.
The server is not responding (or the local server's socket is not correctly configured).
Most likely your MySQL server does not accept connections from external hosts. Unless you are the administrator of the server, you most likely cannot change this.
Related
I am trying to connect mysql database using php. But it is running fine on local machine but not when hosted online and error appeared as
mysqli_connect(): (HY000/2002): Connection timed out
<?php
$link = mysqli_connect('sql6.freesqldatabase.com','user_name','password','database_name');
if(mysqli_connect_error())
die("couldn't connect to database");
?>
Your MySQL server is probably not configured to accept requests from the host you're trying to access it from.
Check the configuration for the server.
Since you say the local machine can access it check where you permitted this and do the same for the ip of the online host.
In my case, AWS firewall was blocking my web server.
Adding the web servers IP address to the firewall exceptions fixed
this for me.
There might firewall in the host which is blocking the request to MySQL server. In my case adding the firewall rule helped me out.
Ubuntu
To allow one device to access the MySQL server,
sudo ufw allow from remote_IP_address to any port 3306
To allow any device to connect to MySQL server,
sudo ufw allow 3306
It worked!
If your website and MySQL database are hosted on separate servers, make sure that you've mentioned correct MySQL hostname (resolvable) in connection string.
In case you've specified the correct username, most probably your MySQL server isn't allowing remote MySQL connections from web server where you site resides.
Contact your web hosting provider for the exact MySQL hostname and to allow your web server IP address for remote MySQL connections.
I think you have to white list your hosting server's ip address to your DB server.
So your DB server will accept requests from your hosting server.
Specify the port (3306?) to the connection string as well.
I have a web server that I can manage via cPanel and I'm trying to connect to a MySql database on a dedicated server (running Ubuntu Server) that I manage. I have two tester connections that give the same error code (from web server to dedicated server).
CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2003] Can't connect to MySQL server on 'IP_ADDRESS' (110)
Can't connect to MySQL server on 'IP_ADDRESS' (110)
I also tried on my computer to connect to the dedicated server and I can do it. I'm using HeidiSQL as a GUI client to try connecting and I can connect to it with the same credentials.
What I have tried:
(I'm using Webmin to manage my mysql server)
Set user host to Any
Checked my.cnf for a bind address and it is bound to 0.0.0.0(all ips)
Checked host permissions for specific databases and set the database to my test user and Any for hosts
The Iptable should just allow all because after installing Ubuntu Server I have not changed anything.
I have no idea what else to try.
I'm trying out Azure for the first time. I followed this guide to create a web application with a MySQL database.
So the DB node was create and I can see it in my resources and I can view the credentials in the properties. However, I can't connect to it from my desktop.
It looks like a firewall issue as I'm unable to telnet to it:
telnet us-cdbr-azure-west-c.cloudapp.net 3306
Trying 104.209.43.4...
telnet: connect to address 104.209.43.4: Operation timed out
telnet: Unable to connect to remote host
Can anyone tell me what I'm doing wrong?
Thanks in advance.
Usually, this issue is raised due to IP or Port is blocked by firewall.
As the comments show that others can connect to your MySQL server, so I think we can exclude that server side firewall blocked your IP and Port.
If you are in a protect network environment, check whether the gateway of network has a white list and your MySQL server endpoint is in the list, or whether the gateway has block the 3306 port. You can change a network environment if possible to check this.
Another attempt is that you can change a PC to have a test to connect to your MySQL server. If it could work, you can compare with the successful PC firewall configuration.
I am developing locally and connecting to a remote mysql server. I had been using IIS on my local machine (WinXP) but am now using Apache instead. Most of my PHP site is working correctly after the move to Apache.
But - when mysqli tries to connect to the remote db I get:
(HY000/2003): Can't connect to MySQL server on '...:**' (10060)
I know that the server is accepting connections from my IP because I am able to connect to the same server from my local machine using MySQL Workbench.
I also know that the db connection details I'm using with mysqli are correct because I was using the same details when running on IIS without problem, the only change that happened is that I moved from IIS to Apache.
This problem still exists when my local firewall is disabled.
I have very little experience with Apache, is there perhaps a config setting I've missed that prevents me from connecting out to a remote db, or something that is mangling/hiding reporting of my correct IP?
Thanks for any help, I'm clutching at straws here...
Error 10060 happens when the remote MySQL server does not respond.
It could be that connections to port 3306 on the remote machine are being blocked. It could be that the system hosting PHP/Apache has a software firewall that is blocking the outgoing connection, or that PHP/Apache is not permitted to open network connections by that firewall.
I am using SMPP with PHP for sending and receiving messages. I got this error when i am
trying to send a message. what is the cause of this and how can i send a message ?
thanks.
pfsockopen() [function.pfsockopen]: unable to connect to sms.korewireless.com:2777 (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. )
Your program tries to connect to remote server, but fails to do it before timeout elapsed.
There could be plenty of reasons for this: server may be not listening this port, your firewall forbids access to it and so on.
Try to connect to that server using telnet to find where problem is.
SMPP usually needs a bind into their server from yours. This could include whitelisting IP's, User/Pass, etc... I would contact their help desk as it sounds to be a configuration error either on your side or theirs.