Bug #28585 mysql_install_db fails
Submitted: 22 May 2007 8:58 Modified: 3 Aug 2007 2:11
Reporter: Jim Dowling Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Packaging Severity:S2 (Serious)
Version:5.1.18, 5.0.41 OS:Any
Assigned to: Jonathan Perkin CPU Architecture:Any
Tags: bfsm_2007_05_31, bfsm_2007_06_21, bfsm_2007_06_28, bfsm_2007_07_19, mysql_install_db

[22 May 2007 8:58] Jim Dowling
Description:
mysql_install_db looks for the SQL file on line 118: 
mysql_system_tables.sql
but doesn't find it and exits with an error.

How to repeat:
~/.mysql/mysql/scripts/mysql_install_db --defaults-file=/home/jdowling/.mysql/ndb-5.1.18-beta-linux-i686-glibc23/mysql_1/my-5-1-18.cnf

/home/jdowling/.mysql/mysql/scripts/mysql_install_db: 118: my_print_defaults: not found
FATAL ERROR: Could not find SQL file './support-files/mysql_system_tables.sql' in
./support-files or inside .

mysql.cnf file contents:

[mysqld]

basedir         = /home/jdowling/.mysql/mysql-5.1.18-beta-linux-i686-glibc23
datadir         = /home/jdowling/.mysql/ndb-5.1.18-beta-linux-i686-glibc23/mysql_1/var
port            = 3306
socket          = /tmp/mysql.sock

pid-file        = /home/jdowling/.mysql/ndb-5.1.18-beta-linux-i686-glibc23/mysql_1/mysqld.pid

#use ndb storage engine and make ndb the default table type
ndbcluster
default-table-type=NDBCLUSTER

#do not include innodb engine (for easier installation)
skip-innodb

[mysql_cluster]
ndb-connectstring=localhost:1186
[22 May 2007 10:05] Sveta Smirnova
Thank you for the report.

Partially verified:

$./mysql-5.1.18-beta-linux-i686-glibc23/scripts/mysql_install_db --datadir=./foo --basedir=./mysql-5.1.18-beta-linux-i686-glibc23
./mysql-5.1.18-beta-linux-i686-glibc23/scripts/mysql_install_db: line 118: my_print_defaults: command not found

Problem does not exists with sources compiled myself.
[22 May 2007 10:09] Jim Dowling
By running the mysql_install_db script from its parent directory, it finds the .sql files, but it now fails on default table type:

070522 12:07:56 [ERROR] Unknown/unsupported table type: ndbcluster
070522 12:07:56 [ERROR] Aborting
[15 Jun 2007 15:14] Max Mether
The same problem still exists in 5.1.19

I tried it with the intel package, ie mysql-5.1.19-beta-linux-i686-icc-glibc23.tar.gz

mysql_install_db still looks for mysql_system_tables.sql in support-files/ when the file locates in share/
[5 Jul 2007 11:52] 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/30367

ChangeSet@1.2504, 2007-07-05 12:51:51+01:00, jonathan@chorlton.adsl.perkin.org.uk +1 -0
  make_binary_distribution.sh:
    This script incorrectly generates the mysql_install_db file, causing the
    problems detailed in bug#28585.  The automake infrastructure correctly
    generates the script, so just copy it in place.
[7 Jul 2007 13:06] Daniel Fischer
I believe this patch is not correct.

The patch changes the search path used in binary distributions to the paths that were specified in configure, this means the script now requires an installed package and tries to use installed files instead of those in the distribution.
[22 Jul 2007 9:40] Bugs System
Pushed into 5.0.48
[22 Jul 2007 9:43] Bugs System
Pushed into 5.1.21-beta
[26 Jul 2007 10:58] 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/31608

ChangeSet@1.2478, 2007-07-26 12:57:46+02:00, jperkin@production.mysql.com +2 -0
  Clean up the mysql_install_db script to ensure that a sane environment is
  available and reduce the chance of failure.  This should fix bug#28585
  which is caused by the script being quite random in how it finds files it
  requires and not giving very good feedback to the user about what went
  wrong.
  
  Also update make_binary_distribution so that it provides the correct path
  to the required SQL scripts when generating mysql_install_db.  The script
  only previously worked because of the permissive behaviour which looked
  around the current working directory before the "correct" location.  This
  could lead to severe problems if the user happened to run the script from
  a location which contained older or even broken copies of the SQL scripts.
  
  We now require either a complete binary release (and the mysql_install_db
  script ran from inside the extracted archive), or an installed compiled
  tree, as this is the only way we can be sure everything that we need is
  available and ready to run.
  
  While working on this fix, also clean up the mysql_install_db script a lot
  to make it simpler, easier to read, and hopefully less prone to bugs in
  the future.
[27 Jul 2007 13:14] 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/31699

ChangeSet@1.2481, 2007-07-27 15:14:21+02:00, jperkin@production.mysql.com +1 -0
  More fixes and cleanups for bug#28585:
  
    - make the 'dist-hook' from top-level Makefile work again.
    - we can find my_print_defaults from --basedir by parsing command
      line arguments prior to running my_print_defaults.
    - take advantage of additional command line parsing and allow the
      --no-defaults etc arguments to work anywhere rather than having
      to be the first argument.
    - find SQL files either from binary archive or source install.
    - consolidate and tidy code and error messages.
[2 Aug 2007 19:12] Bugs System
Pushed into 5.1.21-beta
[2 Aug 2007 19:15] Bugs System
Pushed into 5.0.48
[3 Aug 2007 2:11] Paul Dubois
Noted in 5.0.48, 5.1.21 changelogs.

mysql_install_db could fail to find script files that it needs.