Bug #24270 mysql_install_db doesn't work properly on 5.1
Submitted: 13 Nov 2006 16:41 Modified: 25 Jan 2007 15:24
Reporter: Tobias Asplund Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.1.13-BK, 5.1.12 OS:Linux (Linux, Mac OS X)
Assigned to: Antony Curtis CPU Architecture:Any

[13 Nov 2006 16:41] Tobias Asplund
Description:
The plugins table doesn't seem to load properly with the mysql_install_db script.

How to repeat:
ustr-pavithk:/usr/local/mysql-5.1.12-beta-osx10.4-i686 root# ./scripts/mysql_install_db --datadir=/var/mysql
Installing all prepared tables
./bin/mysqld: Table 'mysql.plugin' doesn't exist
061113 11:31:43 [ERROR] Can't open the mysql.plugin table. Please run the mysql_upgrade script to create it.
Fill help tables
./bin/mysqld: Table 'mysql.plugin' doesn't exist
061113 11:31:43 [ERROR] Can't open the mysql.plugin table. Please run the mysql_upgrade script to create it.

To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h ustr-pavithk.na.uis.unisys.com password 'new-password'
See the manual for more instructions.

You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &

Please report any problems with the ./bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
ustr-pavithk:/usr/local/mysql-5.1.12-beta-osx10.4-i686 root# ls -la /var/mysql
total 0
drwxr-xr-x    5 mysql  admin  170 Nov 13 11:31 .
drwxr-xr-x   25 root   wheel  850 Nov 10 02:11 ..
drwx------    3 root   admin  102 Nov 13 11:31 cluster
drwx------   11 root   admin  374 Nov 13 11:31 mysql
drwx------    2 root   admin   68 Nov 13 11:31 test
ustr-pavithk:/usr/local/mysql-5.1.12-beta-osx10.4-i686 root# ls -la /var/mysql/mysql/
total 120
drwx------   11 root   admin    374 Nov 13 11:31 .
drwxr-xr-x    5 mysql  admin    170 Nov 13 11:31 ..
-rw-rw----    1 root   admin    880 Nov 13 11:31 db.MYD
-rw-rw----    1 root   admin   5120 Nov 13 11:31 db.MYI
-rw-rw----    1 root   admin   9582 Nov 13 11:31 db.frm
-rw-rw----    1 root   admin      0 Nov 13 11:31 host.MYD
-rw-rw----    1 root   admin   2048 Nov 13 11:31 host.MYI
-rw-rw----    1 root   admin   9510 Nov 13 11:31 host.frm
-rw-rw----    1 root   admin    124 Nov 13 11:31 user.MYD
-rw-rw----    1 root   admin   2048 Nov 13 11:31 user.MYI
-rw-rw----    1 root   admin  10466 Nov 13 11:31 user.frm
ustr-pavithk:/usr/local/mysql-5.1.12-beta-osx10.4-i686 root#
[14 Nov 2006 2:30] Lachlan Mulcahy
This seems like it could be tied to use of the STRICT_TRANS_TABLES sql_mode --

1. Untar fresh tarball to /usr/local
2. ln -s mysql-version-dir mysql
3. Add "STRICT_TRANS_TABLES" to your sql_mode in /etc/my.cnf
4. cd /usr/local/mysql
5. ./scripts/mysql_install_db --defaults-file=/etc/my.cnf --user=mysql

Observe errors and check contents of /usr/local/mysql/data/mysql -- only db, host and user tables exist.

The above seems to work without error if STRICT_TRANS_TABLES is omitted??
[14 Nov 2006 9:33] Valeriy Kravchuk
Verified just as described with 5.1.13-BK on Linux:

openxs@suse:~/dbs/5.1> bin/mysql_install_db --datadir=/tmp/5.1
Installing all prepared tables
/home/openxs/dbs/5.1/libexec/mysqld: Table 'mysql.plugin' doesn't exist
061114 10:33:56 [ERROR] Can't open the mysql.plugin table. Please run the mysql_
upgrade script to create it.
Fill help tables

To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/home/openxs/dbs/5.1/bin/mysqladmin -u root password 'new-password'
/home/openxs/dbs/5.1/bin/mysqladmin -u root -h suse password 'new-password'
See the manual for more instructions.

You can start the MySQL daemon with:
cd /home/openxs/dbs/5.1 ; /home/openxs/dbs/5.1/bin/mysqld_safe &

Please report any problems with the /home/openxs/dbs/5.1/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
openxs@suse:~/dbs/5.1> ls /tmp/5.1
cluster  mysql  test
openxs@suse:~/dbs/5.1> ls /tmp/5.1/mysql/
columns_priv.frm   help_relation.frm  tables_priv.frm
columns_priv.MYD   help_relation.MYD  tables_priv.MYD
columns_priv.MYI   help_relation.MYI  tables_priv.MYI
db.frm             help_topic.frm     time_zone.frm
db.MYD             help_topic.MYD     time_zone_leap_second.frm
db.MYI             help_topic.MYI     time_zone_leap_second.MYD
event.frm          host.frm           time_zone_leap_second.MYI
event.MYD          host.MYD           time_zone.MYD
event.MYI          host.MYI           time_zone.MYI
func.frm           plugin.frm         time_zone_name.frm
func.MYD           plugin.MYD         time_zone_name.MYD
func.MYI           plugin.MYI         time_zone_name.MYI
general_log.CSM    proc.frm           time_zone_transition.frm
general_log.CSV    proc.MYD           time_zone_transition.MYD
general_log.frm    proc.MYI           time_zone_transition.MYI
help_category.frm  procs_priv.frm     time_zone_transition_type.frm
help_category.MYD  procs_priv.MYD     time_zone_transition_type.MYD
help_category.MYI  procs_priv.MYI     time_zone_transition_type.MYI
help_keyword.frm   slow_log.CSM       user.frm
help_keyword.MYD   slow_log.CSV       user.MYD
help_keyword.MYI   slow_log.frm       user.MYI
[6 Dec 2006 19:27] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/16544

ChangeSet@1.2325, 2006-12-06 11:27:13-08:00, antony@ppcg5.local +1 -0
  Bug#24270
    "mysql_install_db doesn't work properly on 5.1"
    force default sql mode when in bootstrap. prevents entries in my.cnf
    from breaking the 'install'
[6 Dec 2006 21:48] Antony Curtis
Patch allows system tables to be created. The lone remaining "mysql.plugin doesn't exist" error message will disappear after pending plugin patch is pushed (caused by plugin system trying to load plugins even though --bootstrap is specified)
[2 Jan 2007 17:42] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/17532

ChangeSet@1.2374, 2007-01-02 09:42:13-08:00, acurtis@xiphis.org +3 -0
  Bug#24270
    "mysql_install_db doesn't work properly on 5.1"
    force sql_mode to known value within initialization scripts
[23 Jan 2007 11:37] Antony Curtis
pushed to mysql-5.1-engines tree
[25 Jan 2007 8:42] Sergey Vojtovich
Pushed into tree currently marked as 5.1.15.
[25 Jan 2007 15:24] Paul Dubois
Noted in 5.1.15 changelog.

mysql_install_db did not create the mysql.plugin table if strict SQL
mode was enabled.