[Completely free] Connect to Oracle Always free database (mysql) from public Internet using mysql router
How to run and access Oracle Always free database for entirely free.
1. create Database
Menu > Database > DB Systems
Create DB system
Always Free
username: dbadmin
password: myadminpassword
configure networking: Private subnet default vcn1
placement: any placement but I chose AD-1
It will take about 5 mins
2. create Compute engine to allow public access redirect to Mysql Database
Menu > Compute > Instances
Create Instance
placement: Same placement I put the DB (AD-1)
Choose a free shape (Ampere) in my case since VM.Standard.E2.1.Micro never being available.
subnet: Public subnet-default-vcn1 **** important
add or create new SSH key **** important
3. config redirect
Menu > Networking > Virtual Cloud Networks
add the 2 Ingress Rules
choose default VCN in the list
choose public subnet in the list
choose the only iptable in the list
add 0.0.0.0/0 TCP allow all access now (need to be restricted later to be more secure)
install MySQL & router
configure MySQL router
sudo vi /etc/mysqlrouter/mysqlrouter.conf
replace 10.0.0.11 with your private IP address of MySQL instance
start the router and check status
add firewall rules
4. check the connection from the private subnet
ssh in to the compute engine with ssh key downloaded (or created)
in the instance details, you should see public IP address assigned to the instance
lets say mine is 129.88.88.888
Then, you are in the instance
install client
public IP 129.88.88.888
private IP for MySQL 10.0.0.11
username: dbadmin
password: myadminpassword
check connection in the private network first
if it does not work, trouble shoot with
once you made it work, move on to the public access from your local machine
you can use cli like this or MySQL workbench.
sudo mysql –host 129.88.88.888 -u dbadmin -p
Good luck
Comments
Post a Comment