views:

44

answers:

1

Hi,

I need some advice on how to track down a weird occurence on one of my servers. I'm not a linux expert so please bear with me if I haven't explained properly. We have a test server that is running apache, php5, mysql, postgresql on linux OS. Recently the mysql database have had all tables removed apart from a few. I've investigated the Apache, MySQL and website logs but can't spot anything odd. The server has sugarcrm, davical and drupal sites on there.

Is there something I can do to track the next time this happens?

Thanks Steve

A: 

You should activate query logging on your mysql server. In debian/ubuntu systems you can find the conf file my.cnf at "/etc/mysql/my.cnf". (I dont know which distribution you use) Find the lines

#general_log_file        = /var/log/mysql/mysql.log
#general_log             = 1

and uncomment them deleting the "#"

general_log_file        = /var/log/mysql/mysql.log
general_log             = 1

restart the mysql server

sudo service mysql restart

you can see the changes in the log file from now on

note: You shouldnt use this on production server, or you may face some performance problems

huseyinalb
I would recommend binary logging, not using the general log for this.
Morgan Tocker