Can't connect database software to AWS RDS - mysql

After spending hours trying to debug this problem, I've come out empty-handed.
I'm new to AWS, so it's possible I might be missing something here, but it seems I've exhausted all possibilities based on what I've read online.
So the idea is, I want to create a RDS instance. I'm new to cloud computing as a whole, but how I understand it, this instance is essentially the storage of my relational database on the cloud. Then I connect the DBMS of my liking to it on my local machine. I tried with both Postgresql and MySQL, but both ran into the same issue. Note, when I say I used the two aforementioned DB engines, I made sure that in each case, I set them as the engine when creating the RDS instance. I then configured the security group accordingly.
What I've done:
I've created an admin user as per the aws docs.
I created a security group in the VPC that has the following inbound rule (In this case, I intend to create a RDS instance with MySQL as the engine):
I created an RDS instance with MySQL as the engine, made sure it had public accessibility, and made sure the security group of the VPC was the one I created.
I then tried connecting to the database via both MySQL Workbench and pgAdmin, but both ran into the same issue. I tried using my IP as the source for the security group inbound rule – that didn't work. I then set the source to 0.0.0.0/0, which I understand is all sources; that also unfortunately didn't work.
Any ideas what else I could be doing wrong here? Thanks.

Well, seems I managed to figure it out, albeit indirectly.
I gave up working with AWS and decided to try MongoDB. When connecting to MongoDB Atlas, once again, I couldn't connect. I read up the troubleshooting page in the docs and saw that they recommend you use an outgoing port tester to check if you can reach them from the port they use (27017 in their case). I tested it and found that it wasn't working. I checked to see if it had to do with my firewall (I'm on mac); I disabled it but it didn't do anything. I disabled my VPN (ProtonVPN) and it turned out that it was what was causing the issue. But that's not all there is to it. Although the outgoing port test was working, I still couldn't successfully connect to the DB. So I went to configure the inbound IP address rules so that it would accept from any source, and that was the final fix needed.

Related

Unable to connect to localhost when I want to connect my sql workbench with cloud AWS

I want to do the test hahaha, that I have to access their database. I already install my sql web community installer and I did it.
I can connect to my own username and pass, but when I want to access database in AWS Cloud, it became like this
i's been a long time I didnt manage to work with sql. I just do the queries, I never do this at the start.
Thank you so much if anyone want to help
Two things you need to make this happen.
Make sure you have configured your RDS instance to allow public access.
Make sure you have properly setup the inbound rules to let the IP of your development machine access your RDS instance. See https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.RDSSecurityGroups.html.
Once you do these, you can connect as shown here:

Can't reconnect to database on MySQL Workbench

I recently set up an AWS RDS MySQL instance. I installed MySQL Workbench on my M1 Macbook, successfully connected with my credentials and started working away. The next day, I found that I was no longer connected to the database server, and upon trying to reconnect with the saved credentials - I found that I couldn't.
Unable to connect to localhost
I check the credentials about 8 times, I check the AWS Console to see if everythings okay (status is "Available"). I ended up having to delete my AWS RDS instance, uninstall workbench, and restart everything before it finally worked. I did some more work on this new database.
The next day, I found that the same thing had occurred - I was disconnected from the database server on MySQL workbench, and I could not reconnect.
Why does this keep happening? Please help, as I can't find anything about it on other stackoverflow threads.
I seem to have solved it! I just needed to add my IP address to the AWS RDS instance's "inbound rules", so that it allows traffic coming from me. That step was not described in the documentation here: https://aws.amazon.com/premiumsupport/knowledge-center/connect-rds-mysql-workbench/.
I also noticed that you have the option to allow all traffic to your database, but I figured that would probably pose some kind of security risk so I didn't do it (but perhaps not, since you still need the credentials and endpoint to access it..?).

Why is my MySQL Database on AWS not accessible?

I cannot reach my MySQL Database instance I created on AWS.
What I tried was to set the public access of the Database to "Publicly accessible" here:
Also I tried to set Inbound/Outbound rules for the MySQL port here:
Honestly I think using "All" ports would include 3306 too. Anyways, I tried it this way because yet it didn't work. I cannot connect to the database via MySQL Workbench, nor can I use a ping request on the given endpoint.
I would be glad if someone here has an idea what I could try else.
This will not work if you have deployed it in a private subnet which has no internet access.
Another possibility is that there is ACLs that is stopping the traffic. Security group only touch the RDS instance, the ACLs control traffic in the entire subnet.
Here is a dev AWS tutorial that creates a web application that stores data in MySQL running on the cloud. It will show you how to setup the database and the inbound rules. Once you do, you can store data or query data from MySQL. Likewise, you can use MySQL Workbench to interact with MySQL on the cloud.
AWS RDS Tutorial

Openfire not updating database

I have installed Openfire XMPP server on my linux machine, and everything is working fine except for one thing - for some reason there is some kind of cache mechanism that I can't figure out.
I perform changes on the admin console but the database doesn't change.
I understand there is some sort of cache involved, but how can I stop it? I have external API's querying the database, and the fact the database is not up to date is really a problem.
I am using MySQL and openfire 3.9.3
Thanks!

What is a MySQL Server Instance?

I'm trying to understand what is meant by a Server Instance in MySQL. Googling for the term "MySQL Server Instance" reveals nothing, and the only reference I can find in the documentation refers to using the New Server Instance Wizard, but doesn't seem to explain why I'd ever want to use this.
Coming from a Microsoft SQL Server background, a (named) instance is a completely separate and isolated installation of the server, running in its own process and on its own port. However, in MySQL a (server) instance seems to be a different beast, as for starters it seems to use the same port as my "existing" "instance".
From the Home page of MySQL Workbench, I have the option on the right hand side to create a New Server Instance. What is a MySQL Server Instance, and why would I ever want to create a new one?
A server instance is a MySQL server running somewhere, and also how to connect to it. See the reference manual, which says:
A server instance is created to provide a way of connecting to a server to be managed.
Though it is somewhat circular, it makes sense from configuring the control manager's connection options where one can choose to connect to any number of MySQL servers, or connect to the same server in several different ways (like through a VPN or secondary network).
From this it appears each instance actually does have its own port judging from this guide to setting up an additional instance:
http://www.ducea.com/2009/01/19/running-multiple-instances-of-mysql-on-the-same-machine/
I'm not sure how this interacts in terms of named pipes on Windows though.