Bug #41057 mysql_update fails FATAL ERROR: Failed to create temporary file for defaults
Submitted: 26 Nov 2008 16:18 Modified: 10 Dec 2008 21:13
Reporter: Dave Pullin (Basic Quality Contributor)
Status: Verified
Category:Server Severity:S3 (Non-critical)
Version:5.1.29-rc OS:Microsoft Windows (windows 2KSP4)
Assigned to: Tatjana A. Nuernberg Target Version:5.0+
Tags: qc
Triage: Triaged: D2 (Serious)

[26 Nov 2008 16:18] Dave Pullin
Description:
Bug http://bugs.mysql.com/bug.php?id=28606 which was closed as a duplicate of 
http://bugs.mysql.com/bug.php?id=28774 which is closed (1 Nov 2007) still occurs in
5.1.29-rc

E:\pgm\mysql\bin>mysql_upgrade
Looking for 'mysql.exe' as: E:\pgm\mysql\bin\mysql.exe
Looking for 'mysqlcheck.exe' as: E:\pgm\mysql\bin\mysqlche
FATAL ERROR: Failed to create temporary file for defaults

How to repeat:
Invoke mysql_upgrade.exe
[10 Dec 2008 21:13] Sveta Smirnova
Thank you for the report.

Verified as described in comment "[26 Jun 2007 21:50] Sveta Smirnova" to bug #28606:
create user "guest", then try to mysql_upgrade.
[9 Jan 10:00] Lukas Nevosad
To workaround this bug, run mysql_upgrade.exe as Administrator.
[6 Mar 6:46] Peter Brawley
On 23 May 2007 I reported this bug for 5.1.18 and 5.1.19, for  a server running Windows
2000 SP4. On 29 Jun 2007 that bug report was labelled a duplicate for bug 28774 (filed
one week after I had done). On 18 Oct 2007 the bug page for #28774 reported that a fix
had been pushed 5.1.23-beta and 5.0.52. The bug has been marked closed.

As of 5.1.32, there is no evidence that the mysql_upgrade bug has been corrected.
Executing mysql_upgrade.exe still leads to this:

mysql_upgrade
Looking for 'mysql.exe' as: F:\Program Files\MySQL\MySQL Server 5.1\bin\mysql.exe
Looking for 'mysqlcheck.exe' as: F:\Program Files\MySQL\MySQL Server
5.1\bin\mysqlcheck.exe
FATAL ERROR: Failed to create temporary file for defaults

Neither has the associated bug in mysql_fix_privilege_tables.sql been fixed:

use mysql;
Database changed
source f:\tmp\mysql_fix_privilege_tables.sql;
Outfile disabled.
ERROR:
Unknown command '\m'.
ERROR:
Failed to open file 'f:mp\mysql_fix_privilege_tables.sql', error: 2
[6 Mar 19:13] Peter Brawley
I should add that under Windows 2000 Pro SP4, the bug occurs when mysql_upgrade.exe is run
by Administrator.

Running it as Administrator is NOT a workaround.
[8 Mar 3:48] P Murukesan
I have installed the mysql version mysql-5.1.31-win32 .but still the problem exist .Please
provide the work around solution for this .Waiting for your replay
[30 Apr 1:49] Dave Armour
For what its worth, I was having exactly the same problem as Peter Brawley with
mysql_upgrade on my W2KPRO box. After many attempts, I successfully tried using a tmpdir
command line parameter:
I:\Program Files\MySQL\Server 5.1\bin>mysql_upgrade --tmpdir=I: -p******