Err "Incorrect key file for table 'user'" after 1.6.x upg

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Err "Incorrect key file for table 'user'" after 1.6.x upg

Postby mnemotronic » 08. April 2009 03:22

I've done the 1.6.x to 1.7.0 upgrade (yes, followed the upgrade instructions up to where they failed.). I've had a working xampp install for over a year, and this killed the MySqlD server. I have applied the patch...

Here is output of "mysql_upgrade.exe" from the upgrade instructions:
Code: Select all
C:\Program Files\ApacheFriends.org\xampp\mysql\bin>mysql_upgrade.exe --force -u root -p -t "%TEMP%"
Enter password: ********
Looking for 'mysql.exe' as: C:\Program Files\ApacheFriends.org\xampp\mysql\bin\mysql.exe
Looking for 'mysqlcheck.exe' as: C:\Program Files\ApacheFriends.org\xampp\mysql\bin\mysqlcheck.exe
Running 'mysqlcheck'...
C:\Program Files\ApacheFriends.org\xampp\mysql\bin\mysqlcheck.exe: Got error: 2003: Can't connect to MySQL server on 'localhost' (10061) when trying to connect
FATAL ERROR: Upgrade failed


Obviously the MySql service isn't starting. Here is output of start_mysql.bat (which I've modified to explicitly point to some files)

Code: Select all
C:\Program Files\ApacheFriends.org\xampp>mysql_start.bat
{snip}
"C:\PROGRA~1\APACHE~1.ORG\xampp\mysql\bin\mysqld.exe" 
   --defaults-file="C:\PROGRA~1\APACHE~1.ORG\xampp\mysql\bin\my.cnf"
   --datadir="C:\PROGRA~1\APACHE~1.ORG\xampp\mysql\data"
   --general_log_file="C:\PROGRA~1\APACHE~1.ORG\xampp\mysql\data\general.log"
   --log-error="C:\PROGRA~1\APACHE~1.ORG\xampp\mysql\data\error.log"
   --tmpdir="C:/WINDOWS/Temp"
   --user=pma
   --innodb 
   --standalone
   --console
   --verbose

090407 19:00:01  InnoDB: Started; log sequence number 0 46409
090407 19:00:01 [ERROR] Fatal error: Can't open and lock privilege tables: Incorrect key file for table 'user'; try to repair it


Application event log says same thing:
Code: Select all
Fatal error: Can't open and lock privilege tables: Incorrect key file for table 'user'; try to repair it

For more information, see Help and Support Center at http://www.mysql.com. 


I've removed & reinstalled the MySql service. And the Apache service.
Run "resetroot.bat"
Re-unzipped the 1.6.x to 1.7.0 upgrade.

Run MyIsamChk:
Code: Select all

Run Normal Check....

C:\PROGRA~1\APACHE~1.ORG\xampp\mysql\bin\MyIsamChk.exe 
   --defaults-file="C:\PROGRA~1\APACHE~1.ORG\xampp\mysql\bin\my.cnf"
   --tmpdir="C:/WINDOWS/Temp"   
   --verbose --force --wait --check --information
   "C:\PROGRA~1\APACHE~1.ORG\xampp\mysql\data\mysql\user"

Checking MyISAM file: C:\PROGRA~1\APACHE~1.ORG\xampp\mysql\data\mysql\user
Data records:       9   Deleted blocks:       0
- check file-size
- check record delete-chain
No recordlinks
- check key delete-chain
block_size 1024:
- check index reference
- check data record references index: 1
Key:  1:  Keyblocks used:  17%  Packed:   91%  Max levels:  1
Total:    Keyblocks used:  17%  Packed:   91%

- check record links
Records:                 9    M.recordlength:       57   Packed:             0%
Recordspace used:       99%   Empty space:           1%  Blocks/Record:   1.00
Record blocks:           9    Delete blocks:         0
Record data:           514    Deleted data:          0
Lost space:              7    Linkdata:             35

Run Extended Check....
C:\PROGRA~1\APACHE~1.ORG\xampp\mysql\bin\MyIsamChk.exe 
   --defaults-file="C:\PROGRA~1\APACHE~1.ORG\xampp\mysql\bin\my.cnf"
   --tmpdir="C:/WINDOWS/Temp"   
   --verbose --force --wait --extend-check --information
   "C:\PROGRA~1\APACHE~1.ORG\xampp\mysql\data\mysql\user"

Checking MyISAM file: C:\PROGRA~1\APACHE~1.ORG\xampp\mysql\data\mysql\user
Data records:       9   Deleted blocks:       0
- check file-size
- check record delete-chain
No recordlinks
- check key delete-chain
block_size 1024:
- check index reference
- check data record references index: 1
Key:  1:  Keyblocks used:  17%  Packed:   91%  Max levels:  1
Total:    Keyblocks used:  17%  Packed:   91%

- check records and index references
Records:                 9    M.recordlength:       57   Packed:             0%
Recordspace used:       99%   Empty space:           1%  Blocks/Record:   1.00
Record blocks:           9    Delete blocks:         0
Record data:           514    Deleted data:          0
Lost space:              7    Linkdata:             35

Attempt Repair...
C:\PROGRA~1\APACHE~1.ORG\xampp\mysql\bin\MyIsamChk.exe 
   --defaults-file="C:\PROGRA~1\APACHE~1.ORG\xampp\mysql\bin\my.cnf"
   --tmpdir="C:/WINDOWS/Temp"   
   --verbose --force --wait --extend-check --safe-recover --correct-checksum
   "C:\PROGRA~1\APACHE~1.ORG\xampp\mysql\data\mysql\user"

- recovering (with keycache) MyISAM-table 'C:\PROGRA~1\APACHE~1.ORG\xampp\mysql\data\mysql\user'
Data records: 9
Wrong bytesec: 115-101-114 at          8; Skipped
Wrong bytesec:  49- 51- 55 at         28; Skipped
Wrong bytesec: 118-101-114 at         76; Skipped
Wrong bytesec:  51- 50- 49 at         96; Skipped
Wrong bytesec: 111- 99- 97 at        136; Skipped
Found block that points outside data file at 144
Wrong bytesec:  55-100- 57 at        148; Skipped
Wrong bytesec: 111- 99- 97 at        200; Skipped
Wrong bytesec:   4-114-111 at        208; Skipped
Wrong bytesec:  99-  2-  2 at        228; Skipped
Found block that points outside data file at 232
Found block that points outside data file at 236
Found block that points outside data file at 240
Found block that points outside data file at 244
Found block that points outside data file at 248
Found block that points outside data file at 252
Wrong bytesec: 116- 95- 97 at        268; Skipped
Found block that points outside data file at 300
Wrong bytesec: 111- 99- 97 at        312; Skipped
Wrong bytesec: 115-101-114 at        332; Skipped
Found block that points outside data file at 336
Found block that points outside data file at 340
Found block that points outside data file at 344
Found block that points outside data file at 348
Found block that points outside data file at 352
Found block that points outside data file at 356
Found block that points outside data file at 360
Wrong bytesec: 111- 99- 97 at        372; Skipped
Wrong bytesec: 100-109-105 at        392; Skipped
Found block that points outside data file at 412
Found block that points outside data file at 416
Found block that points outside data file at 420
Found block that points outside data file at 424
Found block that points outside data file at 428
Found block that points outside data file at 432
Found block that points outside data file at 436
Wrong bytesec: 111- 99- 97 at        448; Skipped
Wrong bytesec: 109-116-114 at        460; Skipped
Found block that points outside data file at 480
Found block that points outside data file at 484
Found block that points outside data file at 488
Found block that points outside data file at 492
Found block that points outside data file at 496
Found block that points outside data file at 500
Found block that points outside data file at 504
Wrong bytesec: 116- 95-117 at        520; Skipped
Found block that points outside data file at 528
Found block that points outside data file at 532
Found block that points outside data file at 536
Found block that points outside data file at 540
Found block that points outside data file at 544
Found block that points outside data file at 548
Found block that points outside data file at 552



I've run the MyIsamChk several times and I seem to get the same "errors" during the repair phase each time. The service still doesn't start using "mysql_start.bat"

In addition, the apache log shows:
Code: Select all
[Tue Apr 07 20:13:27 2009] [info] mod_ssl/2.2.11 compiled against Server: Apache/2.2.11, Library: OpenSSL/0.9.8i
Failed loading \xampp\php\zendOptimizer\lib\ZendExtensionManager.dll
PHP Warning:  PHP Startup: Unable to load dynamic library '\\xampp\\php\\ext\\php_gd2.dll' - The specified module could not be found.\r\n in Unknown o
n line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '\\xampp\\php\\ext\\php_gettext.dll' - The specified module could not be found.\r\n in Unkno
wn on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '\\xampp\\php\\ext\\php_imap.dll' - The specified module could not be found.\r\n in Unknown
on line 0
.
.
all php modules seem to fail loading...
.
.



Is there any hope??
Note to new user:
Replace this "signature" with a favorite personal quote or risk looking like a squeamish ossifrage.
mnemotronic
 
Posts: 11
Joined: 16. October 2006 06:07
Location: Boulder

Re: Err "Incorrect key file for table 'user'" after 1.6.x upg

Postby mnemotronic » 10. April 2009 23:36

Solution:
[list=]
[*]Save all user-created databases (dirs under mysql\data)
[*]Save all user-created pages under htdocs
[*]Save all modified configuration files (thank god for perforce....)
[*]Uninstall xampp.
[*]Wipe apachefriends/xampp dir.
[*]Install full version of 1.7.
[*]Restore all modified config files.
[*]Copy saved pages back to htdocs
[*]Copy databases back to mysql\data
[*]Wish you hadn't wasted days trying to fix the upgrade.
[/list]
Note to new user:
Replace this "signature" with a favorite personal quote or risk looking like a squeamish ossifrage.
mnemotronic
 
Posts: 11
Joined: 16. October 2006 06:07
Location: Boulder


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 50 guests