Skip to content

Instantly share code, notes, and snippets.

View maufc's full-sized avatar

Mauricio Flores Cabral maufc

View GitHub Profile
@smching
smching / app_mqtt_mysql.js
Last active August 30, 2022 01:28
Node.js application: Store messages from Mosquitto MQTT broker into SQL Database
var mqtt = require('mqtt');
var Topic = '#'; //subscribe to all topics
var Broker_URL = 'mqtt://192.168.1.123';
var Database_URL = '192.168.1.123';
var options = {
clientId: 'MyMQTT',
port: 1883,
//username: 'mqtt_user',
//password: 'mqtt_password',