Can't reconnect to database on MySQL Workbench - mysql

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..?).

Related

Can't connect database software to AWS RDS

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.

AWS MySQL Database Disappearing

I have a MySQL database running on AWS RDS. I have a node.js server that queries the MySQL database. Everything is fine for most days but around once a week, my node server says "Unknown database."
I try to query the database with MySQL Workbench and receive the same message. I have checked my instance and it is running fine with the status being "available."
To fix the issue, I have to recreate the database which means I lose all my data.
Has anyone had issues with this? This is very frustrating since I have no idea what would cause this problem.
We‘re running MySQL RDS databases since AWS launch and never had such an issue. Are you sure the created database is really gone? Do you maybe have a job running at an interval that doesn’t work as intended? What do the RDS logs say?
To debug the issue you can
have a look at RDS server logs
enable query logging to table and analyze queries fired at the server
run a small instance which is not touched for the period to proof it’s not a RDS-related isssue
A few years later...lol. I had the same problem and realised you have to be connected to the same domain in AWS as your database. If you know the connection string of your database, find the domain it is in. Then in the top right hand side of the aws console you should see a drop down that shows the current domain you are logged into. My guess is the two are not the same. Change the value of the drop down and you should see your database.

Is it possible to run MySQL not as a service

I need to get WAMP stack running on a Windows 7 computer with no admin access.
I managed to get Apache running not as a service and I'm trying to get MySQL working now. I've tried SQLite, but it crashes on the Drupal install.
Is there a way to run MySQL not as a service?
I found this explanation for getting it running without installation, but get the error:
mysqld: Could not create or access the registry key needed for the MySQL
application to log to the Windows EventLog. Run the application with sufficient
privileges once to create the key, add the key manually, or turn off logging
for that application
I'm aware there is another self-answered question on here, but the solution isn't actually what I need.
Sometimes, there is already a MySQL server running on your machine. Try the following steps:
Type Services in search box
Find MySQL service and right click it to stop it.
Try to connect your server in XAMPP or wampp.

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!

How do I download an Amazon RDS database from an instance?

A while ago, I shut down an RDS instance and took a snapshot. Now, a year later, I'd like to download that database. So I restored the snapshot by creating a new instance which is up and running. But I cannot figure out how to download the db.
I have tried connecting to the database via phpMyAdmin but it keeps refusing to connect (even though I have added the IP for phpmyadmin to the security group on amazon). Is there a way to download the database via command line? Something else has to be easier...
There is no other way but connecting to your instance and using any tool you might want to use to do the job - backup
This question was answered before.
download RDS snapshot