Bug #24684 Upgrading
Submitted: 29 Nov 2006 10:54 Modified: 14 Dec 2006 20:00
Reporter: Knut Sparhell Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S2 (Serious)
Version:5.0.27 OS:Windows (Windows)
Assigned to: Assigned Account CPU Architecture:Any
Tags: upgrade, windows

[29 Nov 2006 10:54] Knut Sparhell
Description:
When mySQL is installed to <drive>:\Program files\mySQL the mysql_upgrade complains that "<drive>:\Program" is not an executable. I had to copy the bin and scripts folder to a temporary folder without spaces ot make it run.

Because a column already existed there was an error during checking and it would not run the mysql_fix_privilege_tables.sql script, even with the --force option. I had to run 
mysqld < ..\scripts\mysql_fix_privilege_tables.sql

Then I could use MySQL Administrator to manage my users!

Bug #1: mysql_upgrade seems not handle spaces in basedir
Bug #2: The --force option doesn't make mysql_upgrade continue with the scripts, if the was an error in mysqlcheck

How to repeat:
1) Install mySQL 4.1 to suggested folder, like C:\Program Files\mySQL\mySQL Server 4.1

2) Install mySQL 5.0 to C:\Program Files\mySQL\mySQL Server 5.0

Open a cmd window and "cd C:\Program Files\mySQL\mySQL Server 5.0\bin" and
run:
mysql_upgrade --basedir="C:\Program Files\mySQL\mySQL Server 5.0"

Delete the created version file and repeat.

Suggested fix:
The mysql_upgrade should call the necessary scripts using qouotes around the filepath.

When the --force option is used staring mysql_upgrade, an error from mysqlcheck should not prevent going to he next step (calling the script)
[3 Dec 2006 9:38] Valeriy Kravchuk
Thank you for a bug report. Verified just as described with 5.0.27 on Windows XP.
[8 Dec 2006 18:37] Timothy Smith
Hi!  The first part of this bug report looks like a duplicate of bug #22807.  The second part may be separate.

Regards,

Timothy
[14 Dec 2006 20:00] Iggy Galarza
The first part is a duplicate of the 22807.
The second part is Not a Bug.  Here is the definition of the force command from mysql_upgrade.exe --help:

"
Force execution of mysqlcheck even if mysql_upgrade has
already been executed for the current version of MySQL.
"

In this case the mysqlcheck.exe command fails because of a space in the path. If mysql_upgrade were to continue past this failure and attempt to execute the mysql.exe command it would fail for the same reason.  Successfully executing the mysqlcheck.exe before attempting to execute mysql.exe is a reasonable requirement.