BandwithD resets stats data after restart/reboot

This was a funny one:

I have installed the Bandwithd monitoring software on a machine. I noticed that the monitoring data kept being erased between start/stop or reboot. There actually are two configuration settings which are false by default that allows BandwidthD to keep it’s data across restart’s (or system reboots) and those are

(in /etc/bandwidthd.conf)
[ccNe_bash]
#Log data to cdf file htdocs/log.cdf
output_cdf true

#Read back the cdf file on startup
recover_cdf true
[/ccNe_bash]

(they are false by default, you need to set them true like above)

Mysql authentication issues

Ever happened to you that you create a user with privileges to connect from any host but it won’t connect from the localhost?

Like this:
[cceN_bash]
[root@18969_1_490528 tmp]# mysql -u test_user -puser_pass
ERROR 1045 (28000): Access denied for user ‘test_user’@’localhost’ (using password: YES)

[root@18969_1_490528 tmp]# mysql -u test_user -puser_pass -h yourhost.com
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 55
Server version: 5.0.77 Source distribution

Type ‘help;’ or ‘h’ for help. Type ‘c’ to clear the buffer.

mysql> quit
Bye
[/cceN_bash]
The problem are the anonymous users created by mysql_install_db on initial setup of mysql. Those take precedence. So either you create your user both as ‘test_user’@’%’ and ‘test_user’@localhost either erase those users. I erase them like this as I don’t need two set’s of users for every user I need:

[cceN_mysql]
mysql> select Host,User from user;
+—————-+————–+
| Host           | User         |
+—————-+————–+
| %              | test_user  |
| 127.0.0.1      | root         |
| 18969_1_490528 |              |
| 18969_1_490528 | root         |
| localhost      |              |
| localhost      | root         |
+—————-+————–+
6 rows in set (0.00 sec)

mysql> delete from user where User=”;
Query OK, 2 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

mysql> select Host,User from user;
+—————-+————–+
| Host           | User         |
+—————-+————–+
| %              | test_user  |
| 127.0.0.1      | root         |
| 18969_1_490528 | root         |
| localhost      | root         |
+—————-+————–+
4 rows in set (0.00 sec)

mysql>
[/cceN_mysql]