spencerlambert / mysql-events

A node meteor package that watches a MySQL database and runs callbacks on matched events.
Other
87 stars 76 forks source link

Nothing seems to happen #9

Closed pelomedusa closed 8 years ago

pelomedusa commented 8 years ago

Hi i'm new to node, and i'm trying to make you module work. However, nothing happens when i insert in my database, or even if i update or delete. I hope you can help me. here's my full code: ` var MySQLEvents = require('mysql-events');

var dsn = { host: "localhost", user: "root", password: "mypassword", };

var myCon = MySQLEvents(dsn);

var event1 = myCon.add(

'test.foo.name.value',

function (oldRow, newRow) {

console.log("test");

},

'Active'

);

` Thanks a lot

EDIT: btw, i tried by inserting "Active" in the column "name" of the table "foo", and alose by updating another row!

spencerlambert commented 8 years ago

Do you have binlog turned on in mysql? Also, your mysql user needs REPLICATION privileges. I'm unsure that the default "root" user is setup for replication.

paataD commented 8 years ago

For me too ( the user have DBA priv.

paataD commented 8 years ago

maybe bin-logs files have some problems in charset?

paataD commented 8 years ago

MYSQL CONFIG

 # Must be unique integer from 1-2^32
server-id        = 1
# Row format required for ZongJi
binlog_format    = row
# Directory must exist. This path works for Linux. Other OS may require
#   different path.
log_bin          = /var/log/mysql/mysql-bin.log

binlog_do_db     = employees   # Optional, limit which databases to log
expire_logs_days = 10          # Optional, purge old logs
max_binlog_size  = 100M        # Optional, limit log size

PROBLEM WAS IN

binlog_format = row