Using ESP8266 and Arduino Mega to read values from an online MySQL database?

The WeMos D1 min is basically the same, but smaller. And has a relay shied available (no wires).

The NodeMCU will also work, but maybe not as easy, depending on which relay module.

Both can be powered with a 5volt cellphone charger, connected to the USB socket.

I might leave the http coding over to others with more experience in that field.
Leo..