cannot connect to aws rds anymore - mysql

I am running a db.t2.micro instance on AWS RDS. I used to be able to connect to it via MySQL workbench, but now I can't anymore. Nothing has changed though.
I even re-entered the end point, admin name and password, even though they we're the same still, but still cannot connect.
My elastic beanstalk application that relies on the DB however can still access it. So I suspected the public access had been changed, but that's still enabled too.
Any ideas how to fix this?
Here is the error I am getting:
http://pgrbristol.org.uk/rant/DBError.PNG
I have checked all the points.
Thanks for any help!

Related

MySQL Workbench to AWS RDS

I am new to MySQL Workbench and AWS RDS. I keep getting the following error.
I've looked at other questions on stackoverflow + youtube regarding this connection but it still seems to not work. I've made sure that the Public Access option is switched to yes, I've added an Inbound Rule to allow my IP in the Security Group, I've also added an Inbound Rule to accept from anywhere as well. I've recreated the database to see if something may have been bugged, and I have uninstalled and reinstalled MySQL workbench. I've deleted any existing profiles under the VPC section and allowed the new database to recreate everything. I've enabled and disabled my Windows firewall as well to make sure that didn't somehow affect anything.
Unfortunately I am still getting the same error, and looking for any assistance. Hopefully it's something simple and I am just missing over it.
Thank you for your help in advance.
Edit: Forgot to mention, that I have tried it with the username set to the default "admin" and then I changed it to root as MySQL Workbench had that set in their default connection options.
You're trying to login as the root user, which is restricted on RDS. You have to login as the user account you specified when creating the RDS instance.

MySQL Workbench Cannot Connect to Database Server (Heroku, JawsDB)

My workbench was previously working fine until recently, but I'm now getting the following error:
I'm not sure what's relevant so I'll list out everything that I think might be relevant:
My OS is Windows and I'm using JawsDB & Heroku as my server.
I've recently tried to mess with the my.cnf file (in an attempt to enable 'LOAD DATA LOCAL INFILE')
I think this is the extent to which I've used mysql_config_editor:
I've run "SET GLOBAL local_infile = true;" after logging in to my local sql.
I've checked numbers 1-4 on the error message. Here is an image of my connection to be sure:
I think I've messed with the NetBIOS at some point, and that might be a problem as discussed here, but I don't see "manage server instances" anywhere.
I'm not sure what else might be the issue here. Thanks in advance.
Edit: After trying to connect to the MySQL server through the command line, I get "ERROR 2003 (HY000): Can't connect to MySQL server on 'lyl3nln24eqcxxot.cbetxkdyhwsb.us-east-1.rds.amazonaws.com' (10060)", which seems to be an authentication error and not a connection error according to this link. But I'm unsure how to deal with this authentication error if it is one.
I'm not sure if this constitutes as an answer, but I've managed to establish a connection through my usual wifi (as opposed to a public school's wifi). It looks like either my security settings are different when on a public wifi or the public wifi itself had some sort of security setting that was blocking my connection.

After Aurora Cluster DB failover, unable to write to DB

Right now I am connecting to a cluster endpoint that I have set up for an Aurora DB-MySQL compatible cluster, and after I do a "failover" from the AWS console, my web application is unable to properly connect to the DB that should be writable.
My setup is like this:
Java Web App (tomcat8) with HikariCP as the connection pool, with ConnecterJ as the driver for MySQL. I am evaluating Aurora-MySQL to see if it will satisfy some of the needs the application has. The web app sits in an EC2 instance that is in the same VPC and SG as the Aurora-MySQL cluster. I am connecting through the cluster endpoint to get to the database.
After a failover, I would expect HikariCP to break connections (it does), and then attempt to reconnect (it does), however, the application must be connecting to the wrong server, because anytime a write is hit to the database, a SQL Exception is thrown that says:
The MySQL server is running with the --read-only option so it cannot execute this statement
What is the solution here? Should I rework my code to flush DNS after all connections go down, or after I start receiving this error, and then try to re-initiate connections after that? That doesn't seem right...
I don't know why I keep asking questions if I just answer them (I should really be more patient), but here's an answer in case anyone stumbles upon this in a Google search:
RDS uses DNS changes when working with the cluster endpoint to make it looks "seamless". Since the IP behind the hostname can change, if there is any sort of caching going on, then you can see pretty quickly how a change won't be reflected. Here's a page from AWS' docs that go into it a bit more: https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/java-dg-jvm-ttl.html
To resolve my issue, I went into the jvm's security file and then changed it to be 0 just to verify if what was happening was correct. Seems correct. Now I just need to figure out how to do it properly...

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.