Bug #9209 4.1 won't start with 5.0 privilege tables
Submitted: 15 Mar 2005 22:09 Modified: 16 Mar 2005 0:02
Reporter: Konstantin Osipov (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1 OS:
Assigned to: CPU Architecture:Any

[15 Mar 2005 22:09] Konstantin Osipov
Description:
4.1 server won't start with 5.0 privilege tables:
kostja@dragonfly:~/work/mysql-4.1-root/sql> ./mysqld     
050316  1:04:11 [Warning] setrlimit could not change the size of core files to 'infinity';  We may not be able to generate a core file on signals
050316  1:04:11 [ERROR] ./mysqld: Incorrect information in file: './mysql/user.frm'
050316  1:04:11 [ERROR] Fatal error: Can't open privilege tables: Incorrect information in file: './mysql/user.frm'

How to repeat:
1. Create privilege tables for 4.1
2. Use fix_privilege_tables from 5.0 to upgrade the tables to 5.0 format
3. Start 5.0 server - works fine
4. Start 4.1 server - emits the messages given in description.

This is my .my.cnf:
[mysql]
# The following options will be passed to all MySQL clients
[client]
port        = 3307
socket      = /opt/local/var/mysql/mysql.sock

[mysqld]
#wait_timeout=86400
socket=/opt/local/var/mysql/mysql.sock
port=3307
#language=/home/kostja/work/mysql-4.0-root/sql/share/english
#character-sets-dir=/home/kostja/work/mysql-4.0-root/sql/share/charsets
#basedir=/home/kostja/work/mysql-4.0-root
#datadir=/opt/local/var/mysql-4.0
#language=/home/kostja/mysql/mysql-5.0-1680/sql/share/english
language=/home/kostja/work/mysql-5.0-root/sql/share/english
character-sets-dir=/home/kostja/work/mysql-5.0-root/sql/share/charsets
basedir=/home/kostja/work/mysql-5.0-root
datadir=/opt/local/var/mysql
server_id=1
#debug
#innodb_flush_log_at_trx_commit=1
#enable-pstack
#myisam_sort_buffer=128M
#myisam_max_sort_file_size=4G
#myisam_max_extra_sort_file_size=4G
skip-stack-trace
core-file
skip-innodb
skip-bdb
[16 Mar 2005 0:02] Michael Widenius
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.mysql.com/documentation/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Additional info:

MySQL 5.0 privilege tables uses the new VARCHAR field type that is not supported in 4.1, this is expected.

Fix to get data back in 4.1:
- Rename the mysql directory as 'mysql5'
- Execute the mysql_install_db script in 4.1 to recreate new privilege tables
- Start MySQL 5.0
- Copy data from the mysql5.user to mysql.user
- Repeat for the other tables that you are interested in
- Stop MySQL 5.0
- Start MySQL 4.1

(Yes, we should probably give a better error message for this particular case)