MySQL server on Amazon RDS not reachable from only one host - mysql

I have multiple hosts that connect with a database on an Amazon RDS server. The normal webservers have no trouble connecting with the database, but today I discovered that my development server couldn't connect.
The error I get is
'ERROR 2003 (HY000): Can't connect to MySQL server on
'endpoint.blabla.rds.amazonaws.com' (113)'
Trying to connect via my home laptop gives no problems. It's only the devserver.
When I initiate a connection from the devserver via nc, it gives 'No route to host'. As far as I know, I didn't change anything on the devserver. The databaseserver however has been resized last Thursday, but I'm not sure when the problems have started. I know that it still worked two weeks ago, that's all.
Anyone any experienced this before with Amazon RDS? I really don't know where to look at the moment. The VPC security groups haven't changed, and other servers with the same security groups on the same VPC have no trouble connecting to the database.

Ok it is solved after a couple of hours searching. There was a route in my route table that caused the trouble. I have no idea how it got there, but it is solved now, I can reach the server again. :)

Related

Sudden "unknown MySQL server host error" on AWS with Django

I am receiving a lot of error reports from my Django server throwing:
(2005, "Unknown MySQL server host 'my-address.us-east-1.rds.amazonaws.com' (0)").
The server has been connecting to this database for more than a year without any issue. But this morning I suddenly started to receive this error, even though I didn't do any changes to the code.
Furthermore, when I connect to my website, it actually loads data from the database fine.
Apparently there is a random chance that it won't manage to connect?
Any idea what can cause that and how to fix it?
I am on Amazon lightsail.
There is an active AWS DNS resolving incident in us-east-1 region. Seems like it will be mitigated soon.
https://status.aws.amazon.com/
UPDATE: The issue is now resolved as updated by AWS.

Error 2003 (HY000): can't connect to MySQL server on ' IPv4 address' (10060)

I have a Google Cloud SQL Instance that I have been using for some time now and connecting successfully from MySQL Workbench. However as of yesterday I can't connect using MySQL Workbench (or the command line on my laptop) and get the error:
ERROR 2003 (HY000): Can't connect to MySQL server on '207.xxx.xxx.xx' (10060)
I have done the following already:
Authorised my laptop's IP address (found using whatismyip.com) in the Google Console.
Assigned an IPv4 address to the database in the Google Console.
Created new users and passwords to see if it was a user issue. But that didn't help.
Restarted the instance, restarted my home network/laptop and got new IP addresses (and updated the authorised IP address accordingly).
Upgraded to the latest MySQL workbench 6.3 CE but still have the issue.
The database works as my app can connect to it and accesses the data, I just can't get a remote connection from my laptop.
I am new to this and am out of ideas on how to fix it. Any help would be greatly appreciated.
Thanks everyone for your help. After trying all of your suggestions I found a Google group and logged the issue. Google have responded to it as follows:
David Newgas: For now try connecting from a GCE instance (including cloud shell) or using a GCE instance to proxy connections from your laptop.
I have updated the dashboard with some more information (although it may take a while for you to see it due to caching)
To be clear, this issue will only be affecting first generation instances.
I did not have enough 'points' to comment, so I'll have my say here.
I am having about exactly the same issue. About 10 days ago I connected fine to the Cloud SQL instance, and synced my db up. Yesterday I was going to push some updates etc. But I could not connect, even though I have changed nothing in respect to the database connection, except for the given IPv4.
I figured the issue was with my Django project, based on the App Engine Skeleton, so I created an issue on that project.
https://github.com/GoogleCloudPlatform/appengine-django-skeleton/issues/16
Maybe/Hopefully some we get some information from there.
I had the same problem.
By pure luck I said "Let's try to connect with my local MySQL client while the gcloud command was saying
"Whitelisting your IP for incoming connection for 5 minutes..."
and (mysql local client) worked.

Can't connect to RDS after changing size

I have an RDS instance that I was able to connect to remotely fine for months now. However, tonight I downsized the DB because we we're paying for a lot of unused CPU. After the change from m3.medium to the t2.small I can't connect to it anymore. I have terminal shortcuts setup so I can't be typoing it. I double checked the security groups and thats still applied and the host is the same and everything. I'm not sure what else to try. I just get:
ERROR 2003 (HY000): Can't connect to MySQL server on '<my-host>.us-east-1.rds.amazonaws.com' (60)
I encountered the same problem today. After upsizing the RDS instance, I am unable to connect to it using SSMS which I was able to do just a few hours earlier. It has suddenly stopped working on two PCs so I could not have accidentally changed some parameters. However the web server accessing the RDS within the VPC works fine
sorry for silly question: are you sure my-host didn't change after resizing? Given the error message, it's not credentials. So, it is either address, or security groups, or VPC-based networking.

Intermittent 2013, "Lost connection to MySQL server at 'reading initial communication packet', system error: 0" to CloudSQL

I setup an old Django app on a new GCE instance on Sunday and pointed it to a new CloudSQL instance with imported data there. This code and data has successfully run over the past few years on a variety of dedicated hosting setups, on EC2 and on EC2+RDS.
Since Sunday I have had intermittent reports of 2013, "Lost connection to MySQL server at 'reading initial communication packet', system error: 0" from the App. In particular today it happened in two bursts of 3 separated by about 7 hours.
I panicked in the earlier outages and restarted both the app and the CloudSQL instance which did the trick. However the latter ones today righted themselves after a few minutes.
I've never encountered this error before working with MySQL and any searching on the error gives results related to people who have general access problems to the DB.
On the GCE side the only difference I can think of from previous setups is that it is using Google's out-of-the-box Debian image instead of Ubuntu 12.04. On the MySQL side I have no idea as I've successfully run this on both MySQL 5.x and MariaDB.
Is there any way of figuring out why this is happening and fixing it?
Thanks.
Have you tried changing keep alive settings for TCP connections? GCE has a firewall rules that drops idle TCP connections after 10 mins:
https://cloud.google.com/compute/docs/troubleshooting#communicatewithinternet
You can check current value of 'tcp_keepalive_time':
cat /proc/sys/net/ipv4/tcp_keepalive_time
And change it to 60 seconds:
vi /etc/sysctl.conf
# Add this line
net.ipv4.tcp_keepalive_time = 60
# Reload Sysctl interface
sudo /sbin/sysctl --load=/etc/sysctl.conf
You might need to restart Django server to pick new keep alive settings.
Note: If this problem was limited to yesterday (18/11/2014) and your Cloud SQL instances are located in EU, you might have been affected by this:
https://groups.google.com/forum/#!topic/google-cloud-sql-announce/k5raPT48hc0
It seems there is an issue with the firewall, preventing incoming connections, just change the location from the server to another mirror things suppose to go fine. It worked for me

Connecting to remote MySQL problems

Having a bit of a problem with mysql...
Mysql 5.1 on windows 2008 server iis7
Site on windows 2003 server iis6
[sorry but can't move to linux kids! ;)]
In the process of shifting a site to a new server so I have moved the database 1st and connected the site to the new database. I tested the connection before moving but now the site is connecting to the new database I am having problems....
connecting via PDO the page hangs for an age before getting 'too many connections' error. Monitoring the server I see MANY threads of: 'unathenticated user' from the ip address of the host the site runs on.
I also see a thread for the connection with the correct user name in my config file and I am a total loss as to what is going on.
Any help would be very much appreciated
'unathenticated user' from the ip address of the host the site runs on
A stab in the dark, but this could be some script or process trying to connect to the database server with wrong or empty credentials.
Also, here's a report from somebody who had similar problems - in that case, it was the DNS lookup that caused the problem.
I had a similar situation on my setup where the database lived on a different host than
the webserver. I found the "unauthenticated users" were connections from the webserver
that were hanging on DNS lookups. Don't know if this is a mysql bug or a bug with my
firewall / other setup, but a couple of fixes I found were...
1) start mysql with --skip-name-resolve (you may have to change your mysql permission
tables to have the host's IP instead of hostname, including localhost)
or 2) add the connecting host to your /etc/hosts file.