# netacct-mysql-0.78 don't write into DB



## leks_smile (Feb 13, 2013)

I'm try to use netacct-mysql 0.78
It connect to mysql-server, but nothing write into DB.

```
/usr/local/libexec/mysqld, Version: 5.0.95-log (FreeBSD port: mysql-server-5.0.95). started with:
Tcp port: 3306  Unix socket: /tmp/mysql.sock
Time                 Id Command    Argument
130213 16:41:06	      1 Connect     Access denied for user 'root'@'localhost' (using password: NO)
130213 16:42:14	      2 Connect     acct@localhost on netacct
130213 16:42:44	      3 Connect     acct@localhost on netacct
130213 16:43:15	      4 Connect     acct@localhost on netacct
130213 16:43:40	      5 Connect     acct@localhost on netacct
```


increases counter of droped connections in mysql: 






What am I doing wrong? why mysql abort connection from netacct?

daemon starting OK (/var/log/debug.log):

```
Feb 13 14:55:25 mail nacctd: config: sniff set to 0
Feb 13 14:55:25 mail nacctd: config: pid_file set to /var/run/nacctd.pid
Feb 13 14:55:25 mail nacctd: config: set flushing to 30
Feb 13 14:55:25 mail nacctd: config: set delay on error to 1
Feb 13 14:55:25 mail nacctd: config: set fdelay to 60
Feb 13 14:55:25 mail nacctd: config: added listen device msk0
Feb 13 14:55:25 mail nacctd: config: added listen device tun0
Feb 13 14:55:25 mail nacctd: config: added listen device msk1
Feb 13 14:55:25 mail nacctd: config: set ignoremask 255.255.255.0
Feb 13 14:55:25 mail nacctd: config: added headerinfo (lo:14:12)
Feb 13 14:55:25 mail nacctd: config: added headerinfo (eth:14:12)
Feb 13 14:55:25 mail nacctd: config: added headerinfo (ppp:14:12)
Feb 13 14:55:25 mail nacctd: config: debug level 5
Feb 13 14:55:25 mail nacctd: config: set debug to /tmp/nacctd.debug
Feb 13 16:42:13 mail nacctd: config: sniff set to 0
Feb 13 16:42:13 mail nacctd: config: mysql_user = acct
Feb 13 16:42:13 mail nacctd: config: password ok!
Feb 13 16:42:13 mail nacctd: config: mysql_host = localhost
Feb 13 16:42:13 mail nacctd: config: mysql_port = 0
Feb 13 16:42:13 mail nacctd: config: mysql DB = netacct
Feb 13 16:42:13 mail nacctd: config: pid_file set to /var/run/nacctd.pid
Feb 13 16:42:13 mail nacctd: config: set flushing to 30
Feb 13 16:42:13 mail nacctd: config: set delay on error to 1
Feb 13 16:42:13 mail nacctd: config: set fdelay to 60
Feb 13 16:42:13 mail nacctd: config: added listen device msk0
Feb 13 16:42:13 mail nacctd: config: added listen device tun0
Feb 13 16:42:13 mail nacctd: config: added listen device msk1
Feb 13 16:42:13 mail nacctd: config: set ignoremask 255.255.255.0
Feb 13 16:42:13 mail nacctd: config: added headerinfo (lo:14:12)
Feb 13 16:42:13 mail nacctd: config: added headerinfo (eth:14:12)
Feb 13 16:42:13 mail nacctd: config: added headerinfo (ppp:14:12)
Feb 13 16:42:13 mail nacctd: config: debug level 5
Feb 13 16:42:13 mail nacctd: config: set debug to /tmp/nacctd.debug
Feb 13 16:42:14 mail nacctd: clear_counters() called
Feb 13 16:42:44 mail nacctd: clear_counters() called
```

native debug-file also all is fine(/tmp/nacctd.debug):

```
*CUT*
13/02 16:42:14 [STATE] analyzis for src 192.168.3.129, dst 87.250.250.203, src_flg 113/02 16:42:14 [STATE] , peer_flg 0
13/02 16:42:14 [STATE] analyzis for src 111.221.77.157, dst 192.168.3.69, src_flg -113/02 16:42:14 [STATE] , peer_flg 0
13/02 16:42:14 [STATE] analyzis for src 192.168.3.69, dst 94.245.121.251, src_flg 113/02 16:42:14 [STATE] , peer_flg 0
13/02 16:42:14 [STATE] analyzis for src 87.250.250.203, dst 192.168.3.129, src_flg -113/02 16:42:14 [STATE] , peer_flg 0
13/02 16:42:14 [STATE] analyzis for src 94.245.121.251, dst 192.168.3.69, src_flg -113/02 16:42:14 [STATE] , peer_flg 0
13/02 16:42:14 [STATE] analyzis for src 192.168.3.200, dst 111.111.111.111, src_flg 113/02 16:42:14 [STATE] , peer_flg 0
13/02 16:42:14 [STATE] analyzis for src 111.111.111.111, dst 192.168.3.200, src_flg -113/02 16:42:14 [STATE] , peer_flg 0
13/02 16:42:14 [STATE] analyzis for src 192.168.3.200, dst 111.111.111.111, src_flg 113/02 16:42:14 [STATE] , peer_flg 0
13/02 16:42:14 [STATE] analyzis for src 195.239.111.11, dst 192.168.3.129, src_flg -113/02 16:42:14 [STATE] , peer_flg 0
13/02 16:42:14 [STATE] analyzis for src 192.168.3.129, dst 195.239.111.11, src_flg 113/02 16:42:14 [STATE] , peer_flg 0
13/02 16:42:14 [STATE] analyzis for src 192.168.3.200, dst 111.111.111.111, src_flg 113/02 16:42:14 [STATE] , peer_flg 0
13/02 16:42:14 [STATE] analyzis for src 111.111.111.111, dst 192.168.3.200, src_flg -113/02 16:42:14 [STATE] , peer_flg 0
13/02 16:42:14 [STATE] analyzis for src 195.239.111.11, dst 192.168.3.203, src_flg -113/02 16:42:14 [STATE] , peer_flg 0
13/02 16:42:14 [STATE] analyzis for src 192.168.3.203, dst 195.239.111.11, src_flg 113/02 16:42:14 [STATE] , peer_flg 0
13/02 16:42:14 [STATE] write_log called
13/02 16:42:14 [STATE] lck = 1
13/02 16:42:14 [STATE] lck = 0
13/02 16:42:14 [STATE] write child: synchronized with parent
13/02 16:42:14 [STATE] parent: synchronized with write child
13/02 16:42:14 [STATE] * write process 78116 forked
13/02 16:42:14 [STATE] writepid is 78116
13/02 16:42:14 [STATE] done freeing
13/02 16:42:14 [STATE] -> got signal 20, handling
13/02 16:42:14 [STATE]   set writing to 0, ignored return code
13/02 16:42:14 [STATE]   child 78116 signaled return
13/02 16:42:14 [STATE] <- got signal 20, done handling
13/02 16:42:16 [STATE] analyzis for src 192.168.3.182, dst 111.221.74.31, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.129, dst 87.250.250.203, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 87.250.250.203, dst 192.168.3.129, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.55, dst 74.125.143.91, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 111.221.74.31, dst 192.168.3.182, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 74.125.143.91, dst 192.168.3.55, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.55, dst 74.125.143.91, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.55, dst 74.125.143.91, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 74.125.143.91, dst 192.168.3.55, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 74.125.143.91, dst 192.168.3.55, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 74.125.143.91, dst 192.168.3.55, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.55, dst 74.125.143.91, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.55, dst 74.125.143.91, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.55, dst 74.125.143.91, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.55, dst 74.125.143.91, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.55, dst 74.125.143.91, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.55, dst 74.125.143.91, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.229, dst 217.69.141.226, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 74.125.143.91, dst 192.168.3.55, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 74.125.143.91, dst 192.168.3.55, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 74.125.143.91, dst 192.168.3.55, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.55, dst 74.125.143.91, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 74.125.143.91, dst 192.168.3.55, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 74.125.143.91, dst 192.168.3.55, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 74.125.143.91, dst 192.168.3.55, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.55, dst 74.125.143.91, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 217.69.141.226, dst 192.168.3.229, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.55, dst 74.125.143.138, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 74.125.143.138, dst 192.168.3.55, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.55, dst 74.125.143.138, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.55, dst 74.125.143.138, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.55, dst 74.125.143.91, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 195.239.111.6, dst 192.168.3.132, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 192.168.3.132, dst 195.239.111.6, src_flg 113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 74.125.143.138, dst 192.168.3.55, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 74.125.143.138, dst 192.168.3.55, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
13/02 16:42:16 [STATE] analyzis for src 74.125.143.138, dst 192.168.3.55, src_flg -113/02 16:42:16 [STATE] , peer_flg 0
*CUT*
```


----------



## SirDice (Feb 13, 2013)

Don't use the root account. Create a specific account for this and GRANT it the correct permissions.


----------

