How to access remote MySQL database from Heroku? - mysql

We have a legacy application running in a shared hosting service (JustHost). Due to which I am not able to write any newer technology apps easily.
I have created a test heroku app to talk to the MySQL database that is in the remote server. I have followed the steps from the Heroku side, with respect to adding the remote db url, etc.
But my hosting service allows remote access only from whitelisted IP address (as it should). How does one get a public IP (or IP range) for a Heroku app?

You can try some sort of proxy node with a static IP that securely communicates to your Heroku app

Did you try to search heroku addons for providing static IP? or try this one https://devcenter.heroku.com/articles/quotaguardstatic

Related

Node JS Deploying API to client without any Front End

If i created api in nodejs like login,registration,delete,add,update user like system and i want to give it to my client how can i deploy it??
Like we run our API's on POstman so how client will use it! I don't want to add any front End to it.
You have a few options... you can go for heroku or a virtual private server. For vps you have options like aws ec2, google cloud platform etc. You can host your app in a vps with a static ip. You can use pm2 to host the app. Https is better. Use an nginx reverse proxy for security. Proffesional api servers do the above...

How to connect mysql-client to my spring boot app

I have jar file of springboot and I'm running on compute engineVM
And I also connect SQL-client but what address of mysql should I give in spring boot
I assume you are using GCP's hosted mysql? (Cloud SQL).
If so, then if you are connecting to it via cloud sql proxy, which is running on the same machine, then you just use localhost. The proxy should know the way to the server from there, assuming that you've configured the instance name and project/etc. correctly.
Otherwise, without the proxy, you can use your SQL instance's public IP address, which you can see on the list of running instances when you select the SQL page.
In the second case (using the actual IP address) keep in mind that GCP probably wont let the VM running your application through the firewall to the SQl instance directly. To work around this, you'd have to list your VM's IP address in the Authorized Networks section of the SQL entry (click on your SQL instance in the list and select the Authorization tab). Again, in this case, you need to keep in mind that your VM's IP address is ephemeral by default (unless you made and effort to make it permanent). So if you restart your VM, the above Authorization will no longer make sense. So make sure you make your VM's IP address permanent.

Static ip for application deployed on IBM BlueMix for connecting to SMTP Server

I have deployed an application on IBM BlueMix. The application needs to use a smtp server for sending emails. The smtp server will only allow requests from a static ip. As the application is on the cloud, it may not always have a static ip.
In IBM Bluemix there is a service called as Statica, however that is as per the example only for http and https requests. How can we get a static ip for the application to connect to a smtp server?
Your best best for something like this would probably be to use an SMTP server that accepts some kind of login credentials - having the source IP be static is probably not going to be a tenable solution if you're running an app in the CloudFoundry apps on BlueMix.
If you need a static IP, I'd consider running your apps in the container service, or on a virtual.

I want to connect to my node js application by ipaddress

I want to connect to my nodejs application through ipaddress which i have deployed on openshift.
following is the url of my app
http://myapp-nnms.rhcloud.com/
is this possible to connect through ip address
Usually these shared hosting servers use CNAME to resolve to your server. Means there will be many such server running for same IP, router decides to connect to your server based on host name. So its not possible. If you used your own dedicated server its possible.

Google App script and local database connectivity

I have mysql server installed on my machine. I would like to connect to the same local mysql instance using Google app script's jdbc service. I am getting connection failed error. So, I would like to confirm:
1. is it possible to connect to mysql instance running on private machine(laptop) using jdbc service.
2. If not is it always mandatory to connect to public IP. What is the alternative to connect to mysql instance running on private machine.
This definitely works, but you need to permit Google's machines to connect to your machine. That means opening a hole in your firewall, possibly setting up port forwarding on your router, etc.
There is an alternative to poking a hole in your security arrangement, it is called Secure Data Connector, and it lets your machine initiate the connection to Google - https://developers.google.com/secure-data-connector/
Unfortunately, I don't believe that SDC supports JDBC yet (I believe it only supports HTTP based communication).
(P.S. One very simple work around is to mirror your local database to some kind of cloud service, and then permit access to that replica from Google).