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.

Column count of mysql.db is wrong upgrading mySQL

Discussion in 'Database Discussions' started by Metro2, Jan 17, 2010.

  1. Metro2

    Metro2 Well-Known Member

    Joined:
    May 24, 2006
    Messages:
    376
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    After using WHM to upgrade mySQL from 5.0.45 to 5.1.40 (and then of course running EasyApache to re-compile) on 3 servers, all 3 have been reporting this similar error:

    I'm running cPanel 11.25.0-R42404 / WHM 11.25.0 on REDHAT Enterprise 4

    I can't tell what I might have done wrong because I didn't do anything from shell - all I did was use WHM to click to upgrade mySQL and click to run EasyApache (same way I always have).

    Does anyone know if this is a bug with 5.1.40 and if there is a fix for it that I should somehow apply? Things seem to be running OK so I don't want to mess with it any further if I shouldn't.

    Thanks for any thoughts / opinions / info!
     
  2. Metro2

    Metro2 Well-Known Member

    Joined:
    May 24, 2006
    Messages:
    376
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    Nobody else has encountered this? Just bumping this to give it one last shot here...
     
  3. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    That means the upgrade of the mysql.mysql database failed. There are a variety of ways to fix this. Here are a couple:

    1. Re-run the mysql_upgrade or mysql_fix_privilege_tables script

    2. backup mysql.mysql, shutdown mysql, remove /var/lib/mysql/mysql and use mysql_install_db to recreate it

    Please note these are rather destructive. make sure you have adequate, reliable backups of mysql before pursuing.
     
  4. Metro2

    Metro2 Well-Known Member

    Joined:
    May 24, 2006
    Messages:
    376
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    Thanks for the reply. I'm a bit nervous about this undertaking. I find it unusual that it failed on all 3 servers, and all 3 upgrades were done by using the upgrade link right in WHM... I mean, what are the odds? I've always run "Release" and I always keep WHM/cPanel updated, and no special custom configuration or anything like that (the only thing outside of the standard cPanel modules running are CSF/LFD and Mail Queues from ConfigServer, which I can't imagine would have any influence).
     
  5. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Understandably so. For something so crucial as MySQL fixing those problems can be hair raising.

    This may sound like 'passing the blame' but the problem is really MySQL's flaky upgrade capabilities. A quick google search on similar terms shows lots of people, including many not running cPanel, that have this same problem ( a few bug reports filed with MySQL on the matter also ).

    Another option is forcing a return to MySQL 5.0.

    Are you using FreeBSD?
     
  6. kernow

    kernow Well-Known Member

    Joined:
    Jul 23, 2004
    Messages:
    865
    Likes Received:
    9
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    He's using Redhat Enterprise !
    Metro2.
    You could try running:
    /scripts/mysqlup --force
     
    #6 kernow, Jan 22, 2010
    Last edited: Jan 22, 2010
  7. Metro2

    Metro2 Well-Known Member

    Joined:
    May 24, 2006
    Messages:
    376
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    Correct, I'm running RHEL 4.

    Thank you both for the feedback and pointing out the options. Not quite sure which one is the safe bet at this point.
     
  8. Metro2

    Metro2 Well-Known Member

    Joined:
    May 24, 2006
    Messages:
    376
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    Trying that on one server right now and almost right off the bat I get this:

    Installation of system tables failed! Examine the logs in
    /var/lib/mysql for more information.

    You can try to start the mysqld daemon with:

    shell> /usr/sbin/mysqld --skip-grant &

    and use the command line tool /usr/bin/mysql
    to connect to the mysql database and look at the grant tables:

    shell> /usr/bin/mysql -u root mysql
    mysql> show tables

    and also

    ! YAML::Tiny is not installed
    inc_bundling_support....disabled
    requires:
    ! ExtUtils::Install (1.52) is installed, but we need version >= 1.54
    ! ExtUtils::Installed (1.43) is installed, but we need version >= 1.999
    license_creation........disabled
    requires:
    ! Software::License is not installed

    ERRORS/WARNINGS FOUND IN PREREQUISITES. You may wish to install the versions
    of the modules indicated above before proceeding with this installation
     
  9. noimad1

    noimad1 Well-Known Member

    Joined:
    Mar 27, 2003
    Messages:
    627
    Likes Received:
    0
    Trophy Points:
    16
    Did you ever find a solution to this, because I'm now having the exact same problem???
     
  10. Metro2

    Metro2 Well-Known Member

    Joined:
    May 24, 2006
    Messages:
    376
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    To be honest I cannot remember which part of all the troubleshooting ended up resolving this for me. I do recall running /scripts/mysqlup --force but I don't think that completely did the trick. I'm quite sure that I ended up using EasyApache to re-compile Apache and rebooted my servers after using any of the advice that I found. Sorry that I can't be of more help.. I wish I could remember exactly, and I would have posted a follow-up here, but I was under a lot of pressure and overwhelmed at the time.
     
  11. SuperBaby

    SuperBaby Well-Known Member

    Joined:
    Nov 27, 2003
    Messages:
    331
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Thailand
    cPanel Access Level:
    Website Owner
    Twitter:
    I am getting the same problem. Have you solved yours? Thanks.
     
  12. SuperBaby

    SuperBaby Well-Known Member

    Joined:
    Nov 27, 2003
    Messages:
    331
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Thailand
    cPanel Access Level:
    Website Owner
    Twitter:
    Have I solved the problems????

    This is the earlier problems:
    Then I run this under shell:

    # mysql_fix_privilege_tables --verbose --password=MYSQLPASSWORD

    and I got this:
    And I tried to restart MySQL under WHM and I got this:
    Does that mean I have solved the problems???
     
  13. noimad1

    noimad1 Well-Known Member

    Joined:
    Mar 27, 2003
    Messages:
    627
    Likes Received:
    0
    Trophy Points:
    16
    I dunno, but I know I had to have cpanel go in and fix my mysql. It corrupted quite a few of my customers databases as well, so I had to try to restore some of them, but not all of them worked, so we were kind of stuck...
     
  14. SuperBaby

    SuperBaby Well-Known Member

    Joined:
    Nov 27, 2003
    Messages:
    331
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Thailand
    cPanel Access Level:
    Website Owner
    Twitter:
    Yeah, the server company said it should be OK as I have no problem starting MySQL from shell and WHM. Also, phpMyAdmin works fine.
     
  15. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    The mysql_fix_privilege_tables will almost always resolve the column count problem. In extreme circumstances you may need to start MySQL with skip-grants set in /etc/my.cnf, then run mysql_fix_privilege_tables (following which you need to remove skip-grants and restart MySQL).
     
  16. SuperBaby

    SuperBaby Well-Known Member

    Joined:
    Nov 27, 2003
    Messages:
    331
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Thailand
    cPanel Access Level:
    Website Owner
    Twitter:
    How do I check if my MySQL is working without any problem?
     
  17. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    That's too vague. A vague answer is: no errors are issued in the error log and queries work.
     
Loading...

Share This Page