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.

mysql table corruption with php apps.

Discussion in 'General Discussion' started by cPanelNick, Apr 10, 2003.

  1. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider
    Anyone who is seeing their mysql tables corrupted from a php app should run /scripts/easyapache as the new buildapache will not use php's builtin mysql, instead it will use the libraries installed by mysql. This seems to elimitate the corruption problem. We are still investigating this problem, and more information will be released as it because avalible.
     
  2. AlaskanWolf

    AlaskanWolf Well-Known Member

    Joined:
    Aug 11, 2001
    Messages:
    537
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Fremont CA
    would you see this as being caused from various php files, and then the "max connections used" error that so many of us are use to seeing?

    If so, then yes. Everytime i ran into this problem, i ended up having to run myischeck or whatever it is, on every db on the system, after doing that, sql would re-stablize
     
  3. alwaysweb

    alwaysweb Well-Known Member

    Joined:
    Mar 8, 2002
    Messages:
    97
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Dallas, TX
    cPanel Access Level:
    Root Administrator
    Hi, I'd like to offer some more information that may assist. (worked for us!)

    We did all the /scripts/updatenow and /scripts/fixmysql , updated cpanel more times than I can count, and customer's DB's were still were getting corrupted. We even recompiled apache as Nick indicated, still happening. With over 3000 databases on the server, we were going crazy!

    Then, following the first post on this page:

    http://vbulletin.com/forum/showthread.php?threadid=69070

    we made the my.cnf changes in item #2 , and did 'flush-tables' as mentioned in item #3. Then, we stopped and started MySQL, and it seems to have fixed it... No corruption since!

    (Btw, I also fixed all 'broken' databases in the server with this:

    /usr/bin/mysqlcheck -A --auto-repair

    It may take a while to run depending on how many and the size of your databases & tables, but it sure beats support tickets trickling in for the next two weeks as customers notice corrupted tables.)

    Hope this helps! :D
     
    #3 alwaysweb, Apr 11, 2003
    Last edited: Apr 13, 2003
  4. haze

    haze Well-Known Member

    Joined:
    Dec 21, 2001
    Messages:
    1,550
    Likes Received:
    3
    Trophy Points:
    38
    What exactly is the error and / or problems you are having?
     
  5. MN-Robert

    MN-Robert Well-Known Member

    Joined:
    Feb 19, 2003
    Messages:
    203
    Likes Received:
    0
    Trophy Points:
    16
    Easyapache does not help, I have read that the problem is created by corrupt mysql files.
     
  6. alwaysweb

    alwaysweb Well-Known Member

    Joined:
    Mar 8, 2002
    Messages:
    97
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Dallas, TX
    cPanel Access Level:
    Root Administrator
    Keep up with latest cpanel builds... Try the steps I referenced a few posts up. If nothing else, submit a ticket to cpanel via WHM and provide access for them to get in and assist.
     
  7. MN-Robert

    MN-Robert Well-Known Member

    Joined:
    Feb 19, 2003
    Messages:
    203
    Likes Received:
    0
    Trophy Points:
    16
    I did ronnie :) will let you know how it goes anyway.
     
  8. alwaysweb

    alwaysweb Well-Known Member

    Joined:
    Mar 8, 2002
    Messages:
    97
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Dallas, TX
    cPanel Access Level:
    Root Administrator
    Cool, good luck and godspeed. :D
     
  9. Website Rob

    Website Rob Well-Known Member

    Joined:
    Mar 23, 2002
    Messages:
    1,506
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    Alberta, Canada
    cPanel Access Level:
    Root Administrator
    I would be interested to know as well.

    Since doing the upgrade to,

    WHM 6.2.0
    Cpanel 6.4.0-E1
    RedHat 7.3

    on Thursday, and after running,

    /scripts/updatenow
    /scripts/fixmysql
    /usr/bin/mysql_fix_privilege_tables

    I have not had any error msgs. from the Server or Clients. In fact, since that upgrade went so well I also updated the Zend Optimizer (to v2.1.0) and, although I'm still running PHP v4.2.3, no errors or problems from that end either.

    Details on what errors / problems people are having or receiving and some Server specs., would be most appreciated. If there is (or going to be) a problem, advance knowledge of details would be very helpful.
     
  10. techark

    techark Well-Known Member

    Joined:
    May 22, 2002
    Messages:
    280
    Likes Received:
    0
    Trophy Points:
    16
    What is involved in going back a version?

    This is getting old real quick everyday new tickets coming in and I have tried all the above suggestions and none of them seem to last more than a day or two.
     
  11. alwaysweb

    alwaysweb Well-Known Member

    Joined:
    Mar 8, 2002
    Messages:
    97
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Dallas, TX
    cPanel Access Level:
    Root Administrator
    The problem is with the compile of php using its own mysql lib... The fix is to use the REAL Mysql libs. Run easyapache should fix the problem.. One hint is if you do phpinfo() and it shows under Client API: 4.0.12 then you know your PHP is using real libs but if it says 3.23.39 or anything other than 4.0.12 for example then its using php libs and will cause the corruption... This goes for servers not even using cpanel. Just make sure PHP is indeed using the libs from mysql and not its own.
     
    #11 alwaysweb, Apr 13, 2003
    Last edited: Apr 13, 2003
  12. Website Rob

    Website Rob Well-Known Member

    Joined:
    Mar 23, 2002
    Messages:
    1,506
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    Alberta, Canada
    cPanel Access Level:
    Root Administrator
    What you say makes sense and, although I don't have any corruption problems, I have confirmed that I am using:

    Client API version 3.23.39
    MYSQL_MODULE_TYPE builtin
    MYSQL_SOCKET /var/lib/mysql/mysql.sock

    as per phpinfo() although an upgrade has been done: WHM 6.2.0 - Cpanel 6.4.0-E1 - RedHat 7.3.

    My question would be, is there something 'special' one must look for, when using EasyApache for a PHP compile, in order to make PHP use the mySQL libs and not its own?
     
  13. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Spain
    No, EasyApache compiles it correctly now.
     
  14. andyf

    andyf Well-Known Member

    Joined:
    Jan 7, 2002
    Messages:
    246
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    UK
    try using --with-mysql=/path/to/your/mysql in the configure command for PHP, this will force it to use the external extensions and these will be mySQL 4.
     
  15. Maximiliam

    Maximiliam Well-Known Member

    Joined:
    Feb 24, 2002
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    6
    Found out what the solution was myself, thank you :)

    ARGH!!!

    libmysqlclient.so.10 was interfearing.

    Appearently, if you hit cpanel update now again. It will reinstall the mysql rpms once again and remove the interfearing library (only a symlink though).

    NOTE!!! If you do not run /easyapache or buildapache immediately after the cpanel update now. Apache will fail very quickly. As the old php4 module required the libmysqlclient.so.10 library.

    Thank you and goodbye! :)
     
  16. alwaysweb

    alwaysweb Well-Known Member

    Joined:
    Mar 8, 2002
    Messages:
    97
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Dallas, TX
    cPanel Access Level:
    Root Administrator
    Rob, it seems to only happen to really popular PHP-powered forums for us... Perhaps you don't have any really hoppin' ones, and thus haven't seen the corruption? ;)

    However, run /scripts/easyapache and it should build it all nicely now. (We selected option 6 advanced, checked the FD_SETSIZE increase, and under PHP---> we enabled GD, Curl, Curl SSL, mcrypt, and a few others I believe. Cheers, and good luck.
     
  17. Website Rob

    Website Rob Well-Known Member

    Joined:
    Mar 23, 2002
    Messages:
    1,506
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    Alberta, Canada
    cPanel Access Level:
    Root Administrator
    Thanks Ronnie. Although my most popular Client forum (800MB day) has not reported anything, they do use perl instead of php.

    Thought I read that 'mcrypt' will not work properly, or causes problems? Can't remember all the details, but I take it that with the new mySQL upgrade and PHP (4.2.3 or 4.3.x) there is now, no problem?
     
  18. alwaysweb

    alwaysweb Well-Known Member

    Joined:
    Mar 8, 2002
    Messages:
    97
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Dallas, TX
    cPanel Access Level:
    Root Administrator
    You're welcome. Yes, the corruption is just a PHP/MySQL issue, per this thead's title :) (Your CGI users should be fine if you have DBI or DBD::mysql, etc.) I don't seem to see any issues with mcrypt, it built fine and seem to be working without any issues for us. Just so you know, you can always stop apache (and chkservd to be safe, temporarily) then:

    mv /usr/local/apache /usr/local/apache.bak

    Then run /scripts/easyapache

    If it fails out or you can't get it to build right, just remove the apache directory, and rename the apache.bak folder back... Then start apache. We use this as a 'safe out' in case of issues everytime we build apache.
     
    #18 alwaysweb, Apr 13, 2003
    Last edited: Apr 13, 2003
  19. sexy_guy

    sexy_guy Well-Known Member

    Joined:
    Mar 19, 2003
    Messages:
    848
    Likes Received:
    0
    Trophy Points:
    16
    Couldnt you just recomplile php? Why would one need to recompile everthing?
     
  20. alwaysweb

    alwaysweb Well-Known Member

    Joined:
    Mar 8, 2002
    Messages:
    97
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Dallas, TX
    cPanel Access Level:
    Root Administrator
    Possibly. However, many people (myself included) enjoy the simplicity of letting easyapache do it all. ;)
     
Loading...

Share This Page