Bug #69856 mysql_install_db does not function properly in 5.6 for debug builds
Submitted: 27 Jul 2013 1:48 Modified: 8 Dec 2016 10:12
Reporter: Roel Van de Paar Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: Installing Severity:S1 (Critical)
Version:5.6 OS:Any
Assigned to: Tor Didriksen CPU Architecture:Any

[27 Jul 2013 1:48] Roel Van de Paar
Description:
Output of mysql_install_db for debug builds:

==========
Setting up server with default directories
FATAL ERROR: Could not find     <------------- (!)

If you compiled from source, you need to run 'make install' to 
[...]
==========

Reason is that mysqld is now named mysqld-debug, and the source of mysql_install_db still has;

$mysqld = './bin/mysqld';

And so it fails in;

-x $mysqld or -f "$mysqld.exe" or cannot_find_file($mysqld);

Additionally, not sure why it would not pass the variable correctly to the function so that the output would be clearer and actually tell you what is really missing (instead of just no output at all). This also needs to be fixed so that "FATAL ERROR: Could not find" actually contained what it cannot find in the future.

How to repeat:
./scripts/mysql_install_db --no-defaults --basedir=/some_base_dir --datadir=/some_data_dir

Suggested fix:
1. IMHO, this should not be fixed in mysql_install_db but rather by renaming mysqld-debug to mysqld, as it seemingly was before. This is also how we fixed it in Percona Server
2. Fix the additional error in mysql_install_db so that it correctly reports on whatever it is it cannot find.
[27 Jul 2013 2:00] Roel Van de Paar
https://bugs.launchpad.net/percona-server/+bug/1179359
[27 Jul 2013 21:08] MySQL Verification Team
Hello Roel,

Thank you for the bug report. 
Verified as described.

Thanks,
Umesh
[30 Jul 2013 8:01] MySQL Verification Team
Thank you Roel for correcting the how to part...

How to repeat:

cd /home/ushastry/mybuilds/mysql-5.6.13
mkdir mysql5613
cd mysql5613
cmake ..  -DBUILD_CONFIG=mysql_release -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/home/ushastry/mybuilds/mysql-5.6.13/mysql5613

sudo make
sudo make install

[ushastry@ushastry mysql5613]$ scripts/mysql_install_db --no-defaults --basedir=/home/ushastry/mybuilds/mysql-5.6.13/mysql5613 --datadir=/tmp/69856
FATAL ERROR: Could not find 

If you compiled from source, you need to run 'make install' to
copy the software into the correct location ready for operation.

If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.
[2 Sep 2013 14:52] Tor Didriksen
Hello

The re-naming of the server to mysqld-debug is for internal,
continuous-build purposes. It allows us to build, and test, both
optimized and debug server in the same sandbox.

If you are only building the debug server, you can do 
cmake '-DDEBUG_EXTNAME=OFF'

Alternatively, you can skip the -DBUILD_CONFIG=mysql_release argument to cmake.
[4 Sep 2013 5:43] Roel Van de Paar
Tor, ack. So it's only bug in mysql_install_db that needs fixing then.
[17 Feb 2014 9:41] Roel Van de Paar
Would it be possible to have this fixed?

Google query: 
"FATAL ERROR: Could not find" mysql_install_db

Results:
About 21,200 results
[8 Dec 2016 10:12] Yngve Svendsen
Posted by developer:
 
This is indeed a real bug, but with the time that has passed, the impact is much diminished: Our new style RPMs and Debs on Linux do not use mysql_install_db for any supported MySQL version, MySQL 5.7 and newer do not use mysql_install_db on any platform, and the main delivery vehicle for MySQL on Windows is the new MySQL Installer for Windows, which does not employ mysql_install_db for any version of MySQL. The impacted audience is also limited. Weighing that against the risk and effort of fixing this properly, I am closing this as Not feasible to fix.