Bug #61259 Running mysql_upgrade fails to fix privilege tables with SQL errors
Submitted: 23 May 2011 1:12 Modified: 23 May 2011 6:34
Reporter: Ian McWilliam Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Installing Severity:S2 (Serious)
Version:5.5.12 OS:MacOS
Assigned to: CPU Architecture:Any

[23 May 2011 1:12] Ian McWilliam
Description:
Running mysql_upgrade fails with SQL errors when fixing the privilege tables.

Running 'mysql_fix_privilege_tables'...
ERROR 1064 (42000) at line 46: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant'' at line 1
ERROR 1064 (42000) at line 48: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(14), Column_priv set('Select','Insert','Update','References') COLLATE utf8_gene' at line 1
ERROR 1064 (42000) at line 80: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(14), PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor' at line 1
ERROR 1064 (42000) at line 482: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(14) AFTER Proc_priv' at line 2
FATAL ERROR: Upgrade failed

The database was previously a MySQL 5.1.56 database being upgraded to 5.5.x

How to repeat:
Try running mysql_upgrade against an existing database.
[23 May 2011 4:34] Alexey Kishkin
Hi Ian.

As far as I understand - problem part is timestamp(14) which is ok for mysql 5.1 and produces error in mysql 5.5

But it means you run mysql_upgrade from mysql 5.1 agains mysql 5.5 (despite the fact you should run mysql_upgrade from mysql 5.5).

Could you please double check if you run correct mysql_upgrade?
[23 May 2011 6:34] Ian McWilliam
Hi Alexey,
You are correct. The mysql_upgrade from 5.1 was still being picked up as it was found first in my path.
Running the mysql_upgrade from 5.5, all completed correctly.