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.

trying to update to mysql5 - ERROR: 1136 Column count erro

Discussion in 'General Discussion' started by pcsousa, Nov 27, 2007.

  1. pcsousa

    pcsousa Well-Known Member

    Joined:
    May 28, 2004
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    Hello.

    I'm trying to update several servers from mysql 4.1.22 (mysql Ver 14.7 Distrib 4.1.22, for pc-linux-gnu (i686) using readline 4.3) to mysql 5.0 changing mysql-version=4.1
    at /var/cpanel/cpanel.config and then running /scripts/mysqlup --force but I'm allways getting ERROR: 1136 Column count doesn't match value count at row 1 error.

    I think this is because grant columns at tables inside db mysql are different from 4.X to 5.X. As far as I know, version 5 has more columns per row, at least at users table. Probably script is trying to inject mysql queries without specifiyng column names (like INSERT INTO users VALUES (val1, val2, ...);) which will result in count error.

    Script result suggest log consult at "Examine the logs in /var/lib/mysql for more information" but I found nothing.

    My questions are:
    1. I'm the first one to get this problem? (I made several searchs on this forum without success)
    2. Is my suggest right?
    3. where the script mysqlup saves sql dump?

    Thank you.
    Regards.
     
  2. pcsousa

    pcsousa Well-Known Member

    Joined:
    May 28, 2004
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    When I try to follow script results suggestion

    PHP:
    (...)

    ERROR1136  Column count doesn't match value count at row 1
    071126 20:49:18 [ERROR] Aborting

    071126 20:49:18 [Note] /usr/sbin/mysqld: Shutdown complete

    Installation of system tables failed!

    Examine the logs in /var/lib/mysql for more information.
    You can try to start the mysqld daemon with:
    /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

    Try '
    mysqld --help' if you have problems with paths. Using --log
    gives you a log in /var/lib/mysql that may be helpful.

    (...)

    I get these results:

    PHP:
    root@mondego [/var/lib/mysql]# service mysql restart
    MySQL manager or server PID file could not be found!       [FAILED]
    Starting MySQLCouldn't find MySQL manager or server        [FAILED]
    root@mondego [/var/lib/mysql]# /usr/sbin/mysqld --skip-grant &
    [1] 20846
    071127 20:46:32 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!

    071127 20:46:32 [ERROR] Aborting

    071127 20:46:32 [Note] /usr/sbin/mysqld: Shutdown complete

    root@mondego [/var/lib/mysql]# /usr/sbin/mysqld --skip-grant &
    [2] 20855
    [1]   Exit 1                  /usr/sbin/mysqld --skip-grant
    root@mondego [/var/lib/mysql]# 071127 20:46:58 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!

    071127 20:46:58 [ERROR] Aborting

    071127 20:46:58 [Note] /usr/sbin/mysqld: Shutdown complete


    [2]+  Exit 1                  /usr/sbin/mysqld --skip-grant
     
  3. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Note, you seem to have stopped halfway through the upgrade process. To complete this process, you will need to recompile Apache and PHP. The easiest way to do this is to go to WHM -> Software -> Apache Update. Note, the WHM interface for that setting (WHM -> Server Configuration -> Tweak Settings -> MySQL) has thorough instructions for upgrading to MySQL 5. Among those instructions is that MySQL 5 is not readily downgradable to MySQL 4, so backups are strongly recommended BEFORE the upgrade process commences.

    Note that /scripts/mysqlup does not automatically save a SQL dump/backup of the database. Its purpose is to upgrade MySQL.
     
  4. pcsousa

    pcsousa Well-Known Member

    Joined:
    May 28, 2004
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    Thank you David, but thats not the solution. I've already made mysql update through WHM -> Server Configuration -> Tweak Settings -> MySQL, same error and note, was reversible: just change mysql version at /var/cpanel/cpanel.config and ran /scripts/mysqlup --force.

    More, as far as I know you do not need to recompile apache and php5 in order to mysql runs well. You need to recompile apache+php just to update the way how these applications connects to mysql, update their libraries to work with mysql 5 instead of 4, etc. MySQL is standalone aplication and should run, no matter what version of apache+php you have. I'm I wrong?

    Regards.
     
  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
    This happened once on one of my test servers. The problem was the order of the columns in one of the MySQL privilege tables. /scripts/mysqlup calls a script that ensures the grant tables and their contents are properly updated. This script expects the columns in the grant tables to be in a specific order. When they are not in that order, the error you posted is generated.

    The humorous part (ot me) is the script that does this is part of MySQL (meaning it's not modified by cPanel).

    If I recall correctly, I had to return to the prior version of MySQL, create a backup of the grant tables and restore them in the order required by the upgrade script.

    There are few reports with MySQL about the issue:

    http://bugs.mysql.com/search.php?se...irection=ASC&bug_type=&os=0&phpver=&bug_age=0
     
  6. pcsousa

    pcsousa Well-Known Member

    Joined:
    May 28, 2004
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    Thank you for your tip cpanel cpanelkenneth but I found this very very simple solution at cpanel forum:

    "My problem resolved, i remove my.cnf from mysql 4.x."

    Thats it: mv /etc/my.cnf /etc/my.cnf.old and run /scripts/mysqlup --force

    That's it :)

    Just an alert: osCommerce run on erros after update to mysql5. Just check these tips: http://www.monikamathe.com/oscommerce/mysql5.txt

    Regards.
     
  7. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    heh - even easier.
     
Loading...

Share This Page