Database application and remote MySql - mysql

I would like to create a desktop application that should work with data on a mySql server running on a remote machine.
So each user has a copy of the desktop app and edits data on the remote mySql server.
Now my problem is that the mySql server will not allow connections from other hosts.
Question, is this just the wrong way of creating the app. If not how do I give any host access to the MYsql server.
(I know I can open up for a specific IP but that won't work as the app could be running anywhere)

You should front your database on the server with a thin service layer, where you could do some validation / processing on the data, perform authentication, etc. Your client apps would then expose those methods in your service layer as web services, to which your client apps would communicate using either SOAP/XML, REST/JSON, etc. In general, it is a bad idea to expose your database directly if your application is within a LAN, and a terrible one to expose it on the internet.

Related

Implementing SSL in Java Based Web Applications

I have a java based web application developed in Amazon EC2. It is doing transactions of confidential information. I have a MySQL server installed all by my self in the same amazon instance. The web application access the database via localhost. In Security Groups, I have created a custom security where the port 8080 (the Tomcat) can be accessed only via localhost.
Considering these, do I still need SSL to make sure the transactions are secured?
It depends. Are you comfortable with plain text inside the datacenter? Don't bother with SSL.
Are you worried about that traffic being sniffed locally (tcpdump) or from a malicious source (for instance, if data was being rerouted from the switch between EC2 instances)? Use SSL.
There's a trend of large companies making sure to encrypt local traffic.

Can app on GAE(google app engine) access Mysql server host on VPS/dedicated server?

One of my small python web app hosts on GAE
but I prefer to change its database to Mysql.
GAE database is too special which rely on GAE and not good for future migration.
Can python app on GAE(google app engine) access Mysql server host on VPS/dedicated server?
(of course they are not in same local network with GAE)
if sure, what need to care(firewall, port policy and all others) for Mysql server being open to web?
Sure.
Open the single port needed (3306) inside your firewall of choice.
Always install relevant security updates to the mysql server software as soon as possible.
Create a new mysql user for access from your GAE instance.
Possibly restrict access for this user to one single IP inside of mysql.
(If this is true, you can also enforce it in your firewall of choice too, which hardens the access even more.)
Grant this user as less rights as possible inside mysql.

Connect localhost Codeigniter app to remote database on Dreamhost

I have a number of apps running on Dreamhost and am creating a small app I will use locally to present reports on information stored in various databases. I do not want to host this reporting tool online so I need the app to connect to the remote MySQL server from my machine.
Codeigniter has been giving me an error all afternoon that it can't connect to the remote server, I'm guessing this is down to Dreamhosts security on remote access. I don't have a dedicated IP address so it's not ideal to set on the user account to allow external access. I've tried exploring an IP tracking solution such as No-IP, however I'm not sure if I've configured it properly, or if it'll even the service is capable of allowing my app to access the remote MySQL server when ever it needs.
Does anyone know how to get these working correctly, or am I on the right track??

How do I sync 2 MySQL databases?

I written a program to work with a MySQL database that powers my website and I have recently bought some reseller hosting however the hosting company has restricted external access on the shared server, so I was going to setup an external mySQL database on another server that can be accessed remotely, however to do this I need a PHP file on my reseller server that can connect to the local database and the remote database and sync them on request from the application via a url.
Does anyone know the best method achieve this?
Try using SQLyog's Database synchronization tool

How to write to a remote DB from an android app

We have an android app that currently sends data to a php script which writes to a mysql DB on the same server. We are thinking of using a scalable DB server e.g. FathomDB (which is just based on amazon RDS & rackspace) so that we can handle load increases easily.
The question is how does our android app write to these remote DBs? Do they have some kind of rest API, or allow you to have a php script similar to the one we have in place at the moment?
I'd say most of services like these have a connector running on the web, like the one you are using. But some of the services you mention (for example amazon rds) have a native mysql connection. So you can connect using mysql to the server and run queries like you currently do in php. You can use ACL to ensure security in your application :)