Bug #17531 mysql_upgrade: does not work on Windows
Submitted: 17 Feb 2006 18:10 Modified: 13 Mar 2006 18:35
Reporter: Paul DuBois Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Installing Severity:S1 (Critical)
Version:5.0BK/5.1BK OS:Windows (Windows, Linux)
Assigned to: Assigned Account CPU Architecture:Any

[17 Feb 2006 18:10] Paul DuBois
Description:
The mysql_upgrade script currently works only on Unix.
Monty indicates that it must also work on Windows, to be
invoked by the installer. Here's the relevant portion of
an email exchange:

>> Internally mysql_upgrade works by executing the following commands:
>> 
>> mysqlcheck --for-upgrade --all-databases --auto-repair
>> mysql_fix_privilege_tables

Paul> Does this program run on Windows?  Or is it Unix-only?

Currently it's Unix only.

On windows, this should preferably be done as part of the installer.

For windows users to upgrade, until the installer is fixed, the only
option they have is to run mysqlcheck directly with the above options
followed by executing the mysql_fix_privilege_tables.sql script.

(The last part should also be done by the installer)

How to repeat:
See above.
[18 Feb 2006 3:51] Peter Laursen
Thanks for this :-)

I found the error msgs in my system log and was in the proces of reporting it!
[18 Feb 2006 4:00] Peter Laursen
Problems however:

C:\Programmer\MySQL\MySQL Server 5.1\bin>mysqlcheck --for-upgrade --all-database
s --auto-repair
mysqlcheck: unknown option '--for-upgrade'

C:\Programmer\MySQL\MySQL Server 5.1\bin>mysqlcheck --all-databases --auto-repai
r
mysqlcheck: Got error: 1045: Access denied for user 'ODBC'@'localhost' (using pa
ssword: NO) when trying to connect

Looks like  mysqlchk uses the OLDPW hash for passwords ?
[18 Feb 2006 4:42] Peter Laursen
hmmm ...

trying to use --u and -p options also fails!

Don't you forget that on Windows the MySQL command line does not use OS command line (unlike *nix where is integrated into the shell cammnd) but is a seperate program?

I would appreciate any explanation so that I could get rid of those errors in the system log of my WinXP!
[18 Feb 2006 5:35] Paul DuBois
The option has been renamed. It should be --check-upgrade,
not --for-upgrade.  (But remember, this is for 5.0.19/5.1.7,
which haven't been released yet, so you'll still get an error unless
you're building from the BK source.)

Regarding the connection error for mysqlcheck, the same -u and
-p options should work for mysqlcheck as for any other MySQL
command-line program such as mysql or mysqladmin.
[18 Feb 2006 20:09] Peter Laursen
well yes ...

1) mysqlcheck with correct parameters
2) mysql > source mysql_fix_privileges_tables
3) stop server
4) start server and no err msg in log 'can't open mysql plugin table' this time!

thanks!
[13 Mar 2006 18:35] Reggie Burnett
this is a duplicate of bug # 18115
[6 Oct 2011 14:27] Phil Dodd
I just ran the mysql_upgrade on windows 7 and it worked fine.  You can't use any of the single dash options, you have to use only the double dash options.  Here is the command line I ran that worked:  
mysql_upgrade --host=localhost --user=[user] --password=[password] --force.

I also found that if you create a connection directly to the connection in the remote host instead of the remote host itself that the tables/views/routines show up.  In other words if you have a connection on the remote host of say "databaseuser" with password "U5er", you should set up your local connection in workbench to that connection instead of just the "www.site.com".
[6 Oct 2011 14:29] Phil Dodd
What I meant to say [above] is don't set the connection in workbench to root, set it to a specific connection on the remote host.