The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Database being emptied ?

Discussion in 'General Discussion' started by fuzioneer, Jan 22, 2011.

  1. fuzioneer

    fuzioneer Well-Known Member

    Joined:
    Dec 12, 2003
    Messages:
    98
    Likes Received:
    0
    Trophy Points:
    6
    I have a very simple database hosted under a client account on a cPanel server

    It is used in a multiple Paypal IPN Script and only contains a few entries which are basically an email address and a url to redirect to

    It works fine when I first set it up but then the next day the database is empty !

    I haven't narrowed down when it occurs other than it is during the day during normal working hours the one time i checked

    My immediate thoughts were a script error that causes the database to wipe but the files are encoded so cannot debug but the developer assures me this isn't the case

    Is there anything within cPanel that might cause this, or any means of debugging anyone can think of to trace it ?
     
  2. LinuxTechie

    LinuxTechie Well-Known Member

    Joined:
    Jan 22, 2011
    Messages:
    502
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hello..

    This is strange! Did you check mysql error logs. I don't thinks there is something within cpanel which is causing this issue.
     
  3. fuzioneer

    fuzioneer Well-Known Member

    Joined:
    Dec 12, 2003
    Messages:
    98
    Likes Received:
    0
    Trophy Points:
    6
    y doesnt seem to be anything logged

    I have written a short script and scheduled it via cron to run every 5 mins to simply check the database isn't empty and email if it is so I will get a better timeframe to search within then
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Have you gotten any further details on this issue? You have two other things you could do.

    First of all, you could check the MySQL history file at /root/.mysql_history location, which will show commands run in MySQL command line in root SSH. This will not show commands run by the database itself nor in PhpMyAdmin.

    Next, you could setup the general log to see the commands run (all the commands) for MySQL on the server. This log gets pretty big pretty quickly, so you'd want to ensure to narrow down the time with your cron to get a better idea when to setup the general log to gather the data.

    To setup the general log for your server, you'd put the following into /etc/my.cnf and restart MySQL depending on your MySQL version.

    MySQL 5.0

    You'd need to put the following into /etc/my.cnf file:

    Code:
    log=/var/lib/mysql/general.log
    Then you'd run the following commands to create the file with the right ownership and permissions:

    Code:
    cd /var/lib/mysql
    touch general.log
    chown mysql:mysql general.log
    chmod 660 general.log
    Then restart MySQL:

    Code:
    /etc/init.d/mysql restart
    This would then log to /var/lib/mysql/general.log location.

    MySQL 5.1

    You'd need to put the following into /etc/my.cnf file:

    Code:
    general_log
    Then restart MySQL:

    Code:
    /etc/init.d/mysql restart
    This would then log to /var/lib/mysql/hostname.log location.

    You can see your MySQL version with this command:

    Code:
    mysql_config --version
    My bet is that a cron is running that is wiping the database. You can check crons running around the time the database is wiping by checking /var/log/cron for the cron logs.
     
  5. fuzioneer

    fuzioneer Well-Known Member

    Joined:
    Dec 12, 2003
    Messages:
    98
    Likes Received:
    0
    Trophy Points:
    6
    thx Tristan, it hasn't happened again yet, but my cron is reporting in efficiently so as soon as a i have a timeframe will run through your diagnostics tips
     
Loading...

Share This Page