-->
Page 1 of 2

Is MySql DataBase Possible on ESP8266??

PostPosted: Wed May 25, 2016 12:31 pm
by Ayush Sharma
I Need a Mysql Database on My ESP8266 SPIFFS Memory . I Just need to know, that if i call a Php Script from my Webserver on ESP8266 , Then can it Write to the Database which is inside the SPIFFS Memory of the Module?

This is How I want it to be Done:
User Clicks Button on Webpage > PHP Script is Called > PHP Accesses the DataBase > Read & Write to It. :geek:

Community Help Me! :idea: :!: :)

Re: Is MySql DataBase Possible on ESP8266??

PostPosted: Wed May 25, 2016 1:24 pm
by martinayotte
The ESP8266 is not capable to run a MySQL server.
You should leave this server on the same machine that runs your PHP.
The ESP can still run some HTTP GET request on it to retrieve data.

Re: Is MySql DataBase Possible on ESP8266??

PostPosted: Wed May 25, 2016 5:31 pm
by kenn
Ayush Sharma wrote:I Need a Mysql Database on My ESP8266 SPIFFS Memory . I Just need to know, that if i call a Php Script from my Webserver on ESP8266 , Then can it Write to the Database which is inside the SPIFFS Memory of the Module?

This is How I want it to be Done:
User Clicks Button on Webpage > PHP Script is Called > PHP Accesses the DataBase > Read & Write to It. :geek:


ESP8266 is not a great big webserver with tons of RAM and a hard drive; it is a clever speck of silicon that knows how to communicate over wifi, and some other tricks. You should push any data that needs to be saved directly to some other server, or just write to a buffer or file then retreive or push the saved data somewhere at regular intervals.

Re: Is MySql DataBase Possible on ESP8266??

PostPosted: Thu May 26, 2016 4:39 pm
by MarkR
No.

Get a Raspberry Pi Zero or something - ok, so it doesn't have Wifi, but it can run MySQL.

Or run your mysql server on a real computer somewhere, and have your esp8266 connect to it using some protocol.

It should theoretically be possible (I think) to run a MySQL client on the esp8266, provided you are willing to write the wire protocol code yourself. As far as I can remember, it's a fairly compact binary protocol and will probably be possible to build sql commands even with the limited ram.

It would however, be much easier to have the esp talk to a web app or something similar, and just push data to it that way.