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

pcsousa

Well-Known Member
May 28, 2004
63
0
156
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.
 

pcsousa

Well-Known Member
May 28, 2004
63
0
156
When I try to follow script results suggestion

PHP:
(...)

ERROR: 1136  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:
[email protected] [/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]
[email protected] [/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

[email protected] [/var/lib/mysql]# /usr/sbin/mysqld --skip-grant &
[2] 20855
[1]   Exit 1                  /usr/sbin/mysqld --skip-grant
[email protected] [/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
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,216
12
313
Houston, TX
cPanel Access Level
Root Administrator
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.
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.
 

pcsousa

Well-Known Member
May 28, 2004
63
0
156
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.
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,608
77
458
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
 

pcsousa

Well-Known Member
May 28, 2004
63
0
156
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.
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,608
77
458
cPanel Access Level
Root Administrator
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.
heh - even easier.