Bug #38828 mysql_install_db fails, cannot find fill_help_tables.sql
Submitted: 15 Aug 2008 20:27 Modified: 29 Sep 2009 10:21
Reporter: Eric Myers Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Installing Severity:S3 (Non-critical)
Version:5.0.67, 5.0 bzr OS:Linux (probably any Unix?)
Assigned to: Jonathan Perkin CPU Architecture:Any

[15 Aug 2008 20:27] Eric Myers
Description:
While installing 5.0.51 on Linux mysql_install_db failed because it could not find the file fill_help_tables.sql under the directory specified by --basedir.

I found the file under datadir.

How to repeat:
I used

PREFIX=/usr/local/mysql

./configure --prefix=$PREFIX --with-server --with-innodb  --with-openssl \
                --datadir=/data/mysql     \
                --sysconfdir=$PREFIX  \
                --with-unix-socket-path=/var/run/mysqld/mysqld.sock \
                --with-charset=latin1   \
                --with-comment  --without-debug --with-docs  \
                --with-mysqld-user=postgres

# (There is already a posgress user on this system but no mysqld user,
# so to get started I used that user rather than daemon)

make

make install

mysql_install_db --user=postgres

Suggested fix:
Either have 'make install' put the file under basedir, or have the mysql_install_db look for it under datadir.

Workaround:  I copied *.sql from /data/mysql/mysql to /usr/local/mysql/share 
Then I could get the server up and running.
[15 Aug 2008 22:54] MySQL Verification Team
Thank you for the bug report. Could you please try the latest released version 5.0.67. Thanks in advance.
[15 Sep 2008 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[15 Sep 2008 23:56] Eric Myers
Sorry I missed your comment.  I'll probably have an opportunity to try the latest version in a week or two, and I'll report back here on the result.
[16 Sep 2008 0:07] MySQL Verification Team
Alright. Please re-open this bug when you tested the newer version and comment the result. Thanks in advance.
[16 Oct 2008 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[7 Nov 2008 15:35] Eric Myers
Sorry for the delay, it took a while for me to get back to where I needed to do an other installation.   The problem is indeed present in 5.0.67 as well.

After saying `make install`  I then tried

  $PREFIX/bin/mysql_install_db --user=$USER

which resulted in the error message:
  FATAL ERROR: Could not find fill_help_tables.sql inside --basedir

  When using --basedir you must point either into a MySQL binary
  distribution directory or a compiled tree previously populated
  by 'make install'

The workaround is to copy the files from where they were installed by `make install`, which is $DATADIR/mysql, to where the mysql_install_db script is looking for them:

  mkdir $PREFIX/share
  cp $DATADIR/mysql/*.sql $PREFIX/share

Then the mysql_install_db works as expected.

This suggests that `make install` needs to be adjusted to put the files under $PREFIX/share
[21 Nov 2008 11:12] Sveta Smirnova
Thank you for the report.

Verified as described: all data which should be in share directory are in datadir.

Workaround: mv datadir/mysql share
[29 Sep 2009 10:21] Jonathan Perkin
I can't repeat this with the latest mysql-5.0 tree:

 $ ./configure --prefix=/var/tmp/install-38828 --datadir=/var/tmp/data-38828
 $ make; make install
 $ /var/tmp/install-38828/bin/mysql_install_db

works as expected so I think this has been fixed since.

Note that the ./configure --datadir and the --datadir used by mysql_install_db and mysqld are two different things.  ./configure --datadir refers to where architecture-independant files are installed (such as example configurations and language files), whereas --datadir for mysql_install_db and mysqld are where the mysqld databases are kept which is the meaning I think you were hoping for.

You probably want to use --localstatedir=/data/mysql rather than --datadir for ./configure, this will set mysqld --datadir to the specified value.