我可以直接从我的 Arduino 将项目放入 MySQL 数据库吗? [英] Can I put items in a MySQL database directly from my Arduino?

查看:40
本文介绍了我可以直接从我的 Arduino 将项目放入 MySQL 数据库吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能将数据从带有以太网屏蔽的 Arduino 发送到 MySQL 数据库?

Is it at all possible to send data to a MySQL database from an Arduino with an Ethernet shield?

目前我有数据输出到网页,但我想记录该数据的历史 - 我可以将数据直接发送到数据库吗?

Currently I have data outputting to a webpage, but I would like to record a history of that data - can I send the data directly to a databse?

或者,我是否可以使用 PHP 来捕获数据并将其发送到数据库,而无需经常打开页面,因为我想记录几天内的数据.

Alternatively, can I use PHP to capture the data and send it to a database without having a page constantly open, as I would like to record data over a series of days.

推荐答案

是的,你可以,虽然它可能很乏味.客户端/服务器协议的细节在这里:http://dev.mysql.com/doc/internals/en/client-server-protocol.html 所以这只是在 Arduino 中实现它的问题.鉴于程序内存限制,这可能是一项艰巨的任务.

Yes you can, although it might be tediouis. The details of client/server protocol are here: http://dev.mysql.com/doc/internals/en/client-server-protocol.html so it's just a matter of implementing it in Arduino. Given program memory limitations, it might a difficult task though.

另一种选择,将数据库作为网络服务公开会容易得多.您可以随意定义协议,并将所有 MySQL 处理留给 PHP.

The other option, having database exposed as a webservice would be a lot easier. You can define the protocol however you wish, and leave all MySQL handling to PHP.

这篇关于我可以直接从我的 Arduino 将项目放入 MySQL 数据库吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆