Custom Amazon EC2 instance and managing MySQL - mysql

so I've made an instance at amazon free web service, I've installed through putty mysql, php5, apache and so on on an ubuntu instance... But I can't for the life of me seem to find out how to manage the mysql on that instance. What am I missing? If I look in the Amazon RDS I can only manage for another instance, not for the one I have custom running...

As you have installed MySQL in the EC2 instance you can manage it via terminal.
Login to your instance using putty/ssh and connect to MySQL using below command
mysql --user=username --password=password
you need to install MySQL client if you installed on only MySQL Server.

If I look in the Amazon RDS I can only manage for another instance, not for the one I have custom running...
Yes, RDS is a service where Amazon manages the entire database box for you. The AWS Console manages (paid) RDS instances, not databases in general.
But I can't for the life of me seem to find out how to manage the mysql on that instance.
The "normal" way. Amazon doesn't come with CPanel or other GUI administration tools. Mainly because experts don't need them.
If you want to manage your MySQL graphically, install something like PHPMySQLAdmin or the like.
Note: never open the MySQL port to the internet. If you need to connect to MySQL, use "port forwarding" in Putty to forward port 3306 to the remote box port 3306. Then you can run a MySQL GUI client locally.

Related

Connect To MYSQL Through Virtual Machine

I have windows and am running ubuntu 16.4 on a virtual machine for my analysis, I have installed and created user login and password to mysql databank through VM using this instruction:
https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-20-04
but now I don't understand how I can connect to it with my windows browser? Is it even possible to connect to mysql from my windows because technically I have installed it on another system (VM Ubuntu 16.4)?
I would appreciate if someone could guide me since I am a beginner. thanks
You don't connect to a database server like MySQL using a browser, but rather with a dedicated client program.
Some installations of MySQL also have a web program running called phpmyadmin. You can use that web program from your browser to do things to your MySQL server. But the digital ocean tutorial you followed doesn't install that.
You need a MySQL client program running on your Windows machine to connect to the MySQL server on your VM. Ansgar Becker's HeidiSQL is a good choice. So is MySQL Workbench from the MySQL team.
And, be sure you can ssh from your Windows machine to your VM before you try all this stuff. You'll need to know the IP address of your VM when you connect to your MySQL server from your MySQL client.
Let's say your Windows machine has IP 192.0.2.101 and your VM has IP 192.0.2.121. You need to follow the steps in this part of your tutorial to create a MySQL user profile that can connect from your Windows machine. Something like this.
CREATE USER 'xyz0o'#'192.0.2.101' IDENTIFIED BY 'someHardToGuessPassword';
FLUSH PRIVILEGES;
To create that user you need to ssh into your vm and run the mysql command line program.
Then from your client on your Windows machine you'll connect to the MySQL server on 192.0.2.121 using whatever username / password combination you gave in the CREATE USER command.

Connecting to MySQL server via kubernetes pod using Intellij

We have a MySQL server that is running on AWS using AWS RDS service and some Kubernetes pods which run some services that connect to this MySQL instance.
I have been using Intellij Idea (2020.1) to connect to these MySQL servers for quite some time. However, recently we have changed the policy to connect to these instances, and now it's only possible to connect to the MySQL servers from the Kubernetes pods. Hence, I now need to login to these pods and then query MySQL using the command-line MySQL-client.
Is there any way I can still use Intellij to connect to these MySQL instances than having to log in to the pods using something like SSH tunnelling or something like that?
Yes, setting up an SSH tunnel is recently straight forwards, but the setup depends on your VPC and EC2 configuration. There are a lot of how-tos on the net, e.g.: https://medium.com/#michalisantoniou6/connect-to-an-aws-rds-using-an-ssh-tunnel-22f3bd597924

Can we set up a database on Amazon EC2 similar to how XAMPP is configured on my local system

Can you install MySQL for AWS Elastic Cloud Compute (EC2) directly on the instance? I can't afford to purchase a separate RDS instance at the moment.
My website is setup on AWS EC2 already and now I'm going to try out some features with a database. I need to set up the instance to run on the EC2 localhost and connect it to my website to store my user data.
So first you need to separate XAMPP from mysql in your thought process. XAMPP is a tool only for your local development. You can set up a database on the Elastic Cloud Compute (EC2) instance similarly to how you set up your XAMPP config locally.
Here are the official docs on how to install a full LAMP stack on an EC2 instance running the Amazon Linux AMI - https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html

Connect to AWS-RDS MySQL from another aws Ubuntu server

I am pretty new to aws stack and trying to setup a simple node-mysql app.
Node is running on AWS EC2 Ubuntu 14.04 instance, and MySQL is running on AWS RDS instance.
I am trying to connect to MySQL from my Node client using popular MySQL connector https://github.com/mysqljs/mysql but for some reason always getting 'Connection timeout'. Since node connection doesn't work, I tried to connect using a Telnet just to see if I at least can create any kind of connection.
telnet instance.12345.amazonaws.com 3306
but also unable to connect. Please note both of the connections e.g. though node app and through telnet do work when I try running them from my Windows localhost.
Things I've considered:
EC2 Ubuntu instance has Outbound rules to allow any kind of out
request.
Running app as sudo.
RDS MySQL instance has inbound
port 3306 open.
Installed MySQL client on my EC2 machine.
Basically have no idea on what exact step I've missed during setup and just trying to poke anything possible, any help/suggestion is greatly appreciated.

Connect Amazon EC2 to my Local MySQL Database

Is it possible to do the following?:
I have a local Mac running OS X Lion with a MySQL Server installed which runs different processes regularly and stores data into a local DB.
On the other hand I have an Amazon EC2 instance.
What I would like to do is to use the Amazon instance to perform certain cronjobs (using its own resources) but connecting to the data that is on my localhost (my computer) and performing basic SQL actions like updating the data, inserting, etc.
I don't know if this helps, but I have a static IP. Is there any way I can "open" my IP so the Amazon instance can recognize my home computer as a valid MySQL server?
Thanks for your help, any tip in the right direction will be much appreciated.
If your EC2 instance is connecting to your local db you'll need a static IP locally. Well not need... but if you don't have it anytime you reset your router or loose power etc your ip will change. You can look into Dynamic DNS as well for your local instance.
Your ISP will not block your port on your local instance. This would be a firewall inside your network that is preventing you from connecting to mysql or a configuration with mysql itself. Users can only connect to mysql from certain IP addresses.
You would have to open up the mysql port on your firewall if you are using one, have the mysql client installed on your EC2 instance, and make sure that the user that had proper grantable permissions.
That said why not run cron locally on the mac?
If you can login to your server via SSH then there's no need to open any other port and no static IP is required. You can use SSH port forwarding instead. From your local machine run:
ssh -C -R 5555:127.0.0.1:3306 <your-server-host>
Now you should be able to connect to your Mac's database running on localhost:3306 from the remote server at localhost:5555.