How to send data to mysql

I need a example, that how to send data to mysql. How to send a variable!

I need a example, that how to send data to mysql. How to send a variable!

Sending the data in a variable is trivial. Use Serial.print().

There must be some application on the PC that reads serial data, and adds that data to a MySQL database.

Do you know about a example please? or how to do it?

Do you know about a example please?

An example of what? How to use Serial.print()?

int val = 47;
Serial.print(val);

or how to do it?

I thought how to do "it" was covered in sex-ed. What is "it" you want to be able to do?

Do you know if there's a way to input data to mysql?

As Paul has said, sending the data to the server (via serial or ethernet) is relevatily simple, so long as you send it in some logical way (there are some pre-existing protocols, ie JSON, but that's probably overkill for most datalogging systems).

Once the data is reaches the server you will need some form of software (typically a php, bash or cgi script) that will 'read' the incoming data stream and then insert that into the database. This is the harder part of the process, but there are plenty of examples out there:

http://www.google.co.uk/search?source=ig&hl=en&rlz=1G1GGLQ_ENUK374&q=arduino+php+mysql&oq=arduino+php+&aq=0&aqi=g8g-v2&aql=&gs_sm=e&gs_upl=702l7269l0l8268l17l17l2l2l2l0l218l1544l5.6.1l12

http://www.google.co.uk/search?source=ig&hl=en&rlz=1G1GGLQ_ENUK374&q=arduino+php+mysql&oq=arduino+php+&aq=0&aqi=g8g-v2&aql=&gs_sm=e&gs_upl=702l7269l0l8268l17l17l2l2l2l0l218l1544l5.6.1l12#sclient=psy&hl=en&safe=on&rlz=1G1GGLQ_ENUK374&source=hp&q=arduino+serial+mysql&aq=f&aqi=&aql=f&oq=&pbx=1&bav=on.2,or.r_gc.r_pw.&fp=e856451c47fea1a5&biw=1680&bih=818

As I haven't done this type of project, I can't give you any more direction, but this should get you started. A lot of the people on this forum are very knowledgable but you need ask direct, specific questions to get the answers you want.

AFAIK the Arduino cannot directly to mySQL as it has not the resources to do (the encryption for) the login process.

(Yes, I would be delighted if someone proofed me wrong)

The way to circumvent this problem is to have some application on a PC working as an intermediate or proxy. This can be written in Python, PHP, Processing, C#, VB etc.

AFAIK the Arduino cannot directly to mySQL as it has not the resources to do (the encryption for) the login process.

There may or may not be a serious log in security involved, so encryption is not necessarily required.

However, MySQL is a database application that does not have a mechanism to talk directly to the serial port. Some other application needs to fill that roll. As you pointed out, there are several languages that can be used to write that application. Some of them make talking to MySQL trivial. Others require a bit more effort. Some make talking to, and more importantly listening to, the serial port easy. Others do not. PHP on Windows, for instance, can not read from the Serial port, though it can write to it.

MySQL can provide a socket connection over ethernet, so in theory an Arduino with ethernetshield could (try to) connect directly.

AFAIK there is allways a login procedure with security, that cannot be switched off. Never seen password-less access over the socket ==> dive into the manuals......

I 'm working on a VB aplication with mysql and is working fine.My solution for that was serial comunication.The VB seend data to arduino and arduino reeplies back and VB stores that inside a variable.Then the Vb seends that value inside a table on mysql My project is developing a Domotic house for school and it is almost finish. If you are interest on my code say something For now I have working the following itens: SMS alerts Storing temperature on mysql for processing Turning things on and off Controlling Servos on windows that closes and open acording the sun light

In the future I will post the intire project and all info when is finished