Bug #24248 Problem updating from 5.0.15 to 5.1.12 running under Win XP SP2
Submitted: 13 Nov 2006 10:51 Modified: 8 May 2007 15:53
Reporter: Gisbert Selke (Basic Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Installing Severity:S3 (Non-critical)
Version:5.1.12 OS:Windows (Win XP SP2)
Assigned to: Magnus Blåudd CPU Architecture:Any

[13 Nov 2006 10:51] Gisbert Selke
Description:
Trying to upgrade from 5.0.15 to 5.1.12 creates several problems.
I first removed 5.0.15 with the standard Win Software install facility.

All data directories were left intact by de-installation of previous
version, including the mysql database including all privileges tables.
I then installed from mysql-5.1.12-beta-win32.zip

(1) Problem during installation in Config Wizard: the last step ("apply
security settings") could  not be executed.
Possible reason: root still had its password set from the previous
installation, but the Wizard didn't know about it.
(What should the user do here -- not attempt to change the password? At least a 
hint in the installation dialog would be nice!)

(2) After starting the server, the error log shows this error messages:
061111  0:23:50  InnoDB: Started; log sequence number 2 3691875517
c:\bin\MySQL\bin\mysqld-nt: Table 'mysql.plugin' doesn't exist
061111  0:23:50 [ERROR] Can't open the mysql.plugin table. Please run the mysql_upgrade script to create it.
061111  0:23:51 [Note] c:\bin\MySQL\bin\mysqld-nt: ready for connections.
Version: '5.1.12-beta-community-nt'  socket: ''  port: 3306  MySQL Community Server (GPL)
061111  0:23:51 [ERROR] Column count of mysql.db is wrong. Expected 22, found 20. Created with MySQL 50015, now running 50112. Please use scripts/mysql_fix_privilege_tables
061111  0:23:51 [ERROR] mysql.user has no `Event_priv` column at position 29
061111  0:23:51 [ERROR] SCHEDULER: The system tables are damaged. The scheduler subsystem will be unusable during this run.

Consequently, the events table shows in information_schema, but trying a
SELECT * from it yields an error message.

Attempt to run mysql_upgrade.exe --basedir=[...] yields:
  Could not find file mysql_fix_privilege_tables.sql
...and indeed, this file was not installed during installation.

(3) I am not sure whether this is intentional: the installation does not
copy anything into the scripts subdirectory. (The 5.1.11 version still
has a lot there.) There is also no lib subdirectory installed. 

(4) I copied the mysql_fix_privilege_tables.sql script from the 5.1.11 beta
version and executed it. For the "ALTER TABLE proc", which contains
a clause "MODIFY body longblob DEFAULT '' NOT NULL,", I get the error
message: "BLOB/TEXT column 'body' can't have a default value".
Ignoring this, everything seems to be OK (including item (2) above). 
  

How to repeat:
See description.

Suggested fix:
(1) Take the possibility into account that the root account has a changed password.
(2), (3) Include all necessary scripts.
(4) Fix the fixing script.
[13 Nov 2006 12:36] MySQL Verification Team
Thank you for the bug report.
[19 Nov 2006 10:15] Brice JOLY
Almost the same problem while upgrading from 5.0.26 to 5.1.12beta on Windows XP Pro SP2, using the installer: 

InnoDB: The first specified data file .\ibdata1 did not exist:
InnoDB: a new database to be created!
061119 10:09:18 InnoDB: Setting file .\ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
061119 10:09:18 InnoDB: Log file .\ib_logfile0 did not exist: new to be created
InnoDB: Setting log file .\ib_logfile0 size to 46 MB
InnoDB: Database physically writes the file full: wait...
061119 10:09:19 InnoDB: Log file .\ib_logfile1 did not exist: new to be created
InnoDB: Setting log file .\ib_logfile1 size to 46 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
061119 10:09:20 InnoDB: Started; log sequence number 0 0
C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld-nt: Table 'mysql.plugin' doesn't exist
061119 10:09:20 [ERROR] Can't open the mysql.plugin table. Please run the mysql_upgrade script to create it.
061119 10:09:20 [Note] C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld-nt: ready for connections.
Version: '5.1.12-beta-community-nt' socket: '' port: 3306 MySQL Community Server (GPL)
061119 10:09:20 [ERROR] SCHEDULER: Table mysql.event is damaged. Can not open
061119 10:09:20 [Note] SCHEDULER: Purging queue. 0 events
061119 10:09:20 [ERROR] SCHEDULER: Error while loading from disk.

I tried running mysql_upgrade, here comes the result: 

C:\Program Files\MySQL\MySQL Server 5.1\bin>mysql_upgrade.exe --base=".." -uroot
-p
Enter password: ********
mysql.columns_priv OK
mysql.db OK
mysql.func OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.proc OK
mysql.procs_priv OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
ERROR 1060 (42S21) at line 28: Duplicate column name 'File_priv'

Only the error log could be created, those errors prevented any other log to be created (even with FILE,TABLE): slow, query etc.
[8 Mar 2007 14:44] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/21505

ChangeSet@1.2470, 2007-03-08 15:43:54+01:00, msvensson@pilot.blaudden +3 -0
  Bug#24248 Problem updating from 5.0.15 to 5.1.12 running under Win XP SP2
   - Fix error message to say that "mysql_upgrade" should be run when
   a particular error message is found to be missing
   - Dont's set default value on blob's - it will not be used anyway.
[8 Mar 2007 14:45] Magnus Blåudd
Thanks for your bug report, that describes several problems. The attached patch in addition to a new version of mysql_upgrade will fix this.
[26 Apr 2007 11:34] Bugs System
Pushed into 5.0.42
[26 Apr 2007 11:35] Bugs System
Pushed into 5.1.18-beta
[8 May 2007 0:34] Paul DuBois
Noted in 5.0.42, 5.1.18 changelogs.

Some upgrade problems are detected and better error messages
suggesting that mysql_upgrade be run are produced.