Bug #45104 mysqld fails to create all required tables
Submitted: 26 May 2009 18:57 Modified: 5 Jun 2009 14:19
Reporter: norbert van Nobelen Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: General Severity:S4 (Feature request)
Version:5.1.x, 6.0.11-alpha OS:Linux (OpenSuse 10.3)
Assigned to: CPU Architecture:Any
Tags: clean, install, mysql.host, mysql.plugin

[26 May 2009 18:57] norbert van Nobelen
Description:
Fresh unzip of 6.0.11, empty mysql directory. Start of mysqld fails:

linux:/var/lib/mysql # mysqld --user=mysql &
[1] 15659
linux:/var/lib/mysql # 090526 20:53:08 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
090526 20:53:08 [Note] Falcon: unable to open system data files.
090526 20:53:08 [Note] Falcon: creating new system data files.
InnoDB: The first specified data file /var/lib/mysql/ibdata1 did not exist:
InnoDB: a new database to be created!
090526 20:53:08  InnoDB: Setting file /var/lib/mysql/ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
090526 20:53:08  InnoDB: Log file /var/lib/mysql/ib_logfile0 did not exist: new to be created
InnoDB: Setting log file /var/lib/mysql/ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
090526 20:53:09  InnoDB: Log file /var/lib/mysql/ib_logfile1 did not exist: new to be created
InnoDB: Setting log file /var/lib/mysql/ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
090526 20:53:09  InnoDB: Started; log sequence number 0 0
090526 20:53:09 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist

How to repeat:
create an empty /var/lib/mysql directory
install mysql by unzipping mysql-6.0.11-alpha-linux-x86_64-glibc23.tar.gz
ln -s /opt/mysql-6.0.11-alpha-linux-x86_64-glibc23 mysql
EXPORT PATH=$PATH:/opt/mysql/bin
mysqld --user=mysql &

Returns the failure.

Tried twice:
Added /var/lib/mysql/mysql directory to see if this helps.
Checked /opt/mysql/data for files: None of importance

Suggested fix:
No clue.
[26 May 2009 19:00] norbert van Nobelen
Some issue with 6.0.10.
Might be a my.cnf issue:
[client]
#password       = your_password
port            = 3306
socket          = /var/lib/mysql/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port            = 3306
socket          = /var/lib/mysql/mysql.sock
skip-locking
key_buffer = 32M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 2M
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 16M
query_cache_size=32M
query_cache_limit=32M
max_connections=80
server-id       = 1
innodb_data_home_dir = /var/lib/mysql/
innodb_log_group_home_dir = /var/lib/mysql/
innodb_buffer_pool_size = 128M
innodb_additional_mem_pool_size = 32M
innodb_log_file_size = 5M

# The safe_mysqld script
[safe_mysqld]
err-log=/var/lib/mysql/mysqld.log

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash

[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout
[26 May 2009 19:02] norbert van Nobelen
Placed on serious because I require the mysql/*.frm tables due to another issue with failing to properly upgrade the tables -> Mysql does not want to execute one date function.
[26 May 2009 19:13] norbert van Nobelen
Workaround found:
Remove the offending tables from /var/lib/mysql/mysql.
Run mysql_upgrade
Upgrade now works with error.
[26 May 2009 19:15] Jonas Sundin
Did you run:

scripts/mysql_install_db --user=mysql

as described in:

http://dev.mysql.com/doc/refman/6.0/en/installing-binary.html

to create the tables?
[27 May 2009 17:35] norbert van Nobelen
Ok, manual reading should have helped.
Than 1 suggestion: Change the line: 
090526 20:53:08 [ERROR] Can't open the
mysql.plugin table. Please run mysql_upgrade to create it.

To something suggestion this user failure:
090526 20:53:08 [ERROR] Can't open the
mysql.plugin table. Please run scripts/mysql_install_db --user=mysql to create it.
[5 Jun 2009 14:19] Valeriy Kravchuk
More detailed/precise instructions in the error message would be useful.