Save data to MySql database - Arduino should be in server mode or client mode

Hi! All Members,

This is my very first post in this forum. I have a question which i would like to ask.

To be able to save data to a MySql database, should the Arduino be in server mode or client mode. I'm using a Arduino Uno and a Ethernet shield. Also would it make a difference if the MySql database is on a local PC or on a online web server (hosting site), in the sense of saving data. Is the same code used to save data in both cases.

Any help provided would be highly appreciated.

Thank You.

should the Arduino be in server mode or client mode.

Do you know what a client does?
Do you know what a server does?

A client makes requests, like "Hey, server, can you store this data in the database?"

A server services requests.

It's not really too difficult to figure out what role the Arduino needs to be performing.

Hi PaulS,

Yes. I have a general idea of what a client and a server do, but was wondering if i put the arduino in server mode would it still be able to send data to the MySql database (server --> server).

I'm still in the process of learning the arduino and have doubt and difficulties. So my intention is to hook up some sensors to the arduino server and display the data on a HTML page as well as save the sensor data to a MySql database on a online web server over the internet.

BTW thank you very much for taking your time to answer my question.