Connect to a remote SQL database?

I have an application that periodically collects data and then needs to forward that data to a remotely located SQL database server via TCP. My application needs to login and authenticate before INSERTING data by using standard SQL commands. Data is only going to the server. Currently there is no requirement to fetch data from the server.

I looked at “sqlite” which is included with Linux v5, but “sqlite” seems to be only a local SQL embedded database (quite nice if data is to remain on that system only).

THe open source “mySQL” database has an API called mySQL Connect. I’ve used it on an x86 PC, but have never tried to recompile it for an ARM processor.

Has anyone done something similar with the Digi embedded Linux package? Any ideas or comments are welcome.

Doug

Hello,
AFAIK, MySql is too big to be embedded on smallsystem (I’m talking about ConnectME9210).
Some informations:
http://en.wikipedia.org/wiki/Embedded_database
Regards,

Message was edited by: monnoliv

I agree that installing all of mySQL would hog resources and may not work well at all.

Actually all I have to do in my app is periodically collect data and INSERT it into a remote mySQL database. Data only goes from the client to the remote host. The client never has to query or modify the remote database. So actually all I think I need is that part of mySQL which makes remote connections. The only time I would need to store data on the ME9210 device is when the remote server is not available. For that I will use sqlite which is already included in the ME9210 setup. Too bad sqlite doesn’t provide remote connections.

The app requirements specifically prevent me from just doing a simple TCP-to-TCP transfer of data to an intermediate custom application on the remote host, and then have that application insert the data into mySQL. The customer does not want to be burdened with another custom program on the remote host.

I used Wireshark to capture both sides of a mySQL transaction and it is complicated. The server and client exchange a lot of information on their respective capabilities. This handshake data showed up as both binary and ASCII combined…and the field lengths seemed to vary.

Ok,
What you need is a client MySQL.
Look at this link, there is a ARM library. I don’t know more about this:
http://linux.maruhn.com/sec/mysql-client.html
BTW, sniffing datas with Wireshark to guess the protocol seems a big task to do! :slight_smile:
Regards,

Message was edited by: monnoliv

Very interesting. I noticed at least three ARM packages that might work. I’m going to start exploring these on Monday AM.

Regarding the Wireshark analysis. It revealed just how complicated the initial connect handshake can be. It also revealed that trying to write custom code for this would probably not be easy or successful.

Thanks for your input.