Description:
#1: mysql_install_db cannot locate mysqld;
[sda]$ rm -Rf /dev/shm/573153
[sda]$ ./MS-mysql-5.7.5-m15-linux-x86_64-debug/bin/mysql_install_db --no-defaults --datadir=/dev/shm/573153
2015-02-13 06:38:07 [ERROR] Can't locate the server executable (mysqld).
[sda]$ cd MS-mysql-5.7.5-m15-linux-x86_64-debug
[MS-mysql-5.7.5-m15-linux-x86_64-debug]$ ./bin/mysql_install_db --no-defaults --datadir=/dev/shm/573153
[...mysqld was found...]
So, if mysql_install_db can find mysqld when being used as ./bin/mysql_install_db, why can it not locate it when it's used as ./somedir/bin/mysqld_install_db?
#2 mysql_install_db cannot locate basedir automatically and is undescriptive in it's own output;
[MS-mysql-5.7.5-m15-linux-x86_64-debug]$ ./bin/mysql_install_db --no-defaults --datadir=/dev/shm/573153
2015-02-13 06:38:21 [ERROR] The child process terminated prematurely. Errno= 32
2015-02-13 06:38:21 [ERROR] Failed to execute /sda/MS-mysql-5.7.5-m15-linux-x86_64-debug/bin/mysqld --no-defaults --bootstrap --datadir=/dev/shm/573153/131/da
ta --lc-messages-dir=/usr/share/mysql --lc-messages=en_US
-- server log begin --
-- server log end --
Error 32 ("broken pipe"), no sever log ouptut, nothing descriptive; it's completely unclear what went wrong. Also, it now has auto-found mysqld, so why not look for other bits it needs?
Finally,
./bin/mysql_install_db --no-defaults --datadir=/dev/shm/573153/131/data --basedir=${PWD}
Works fine.
How to repeat:
#1 ./somedir/bin/mysql_install_db --no-defaults --datadir=/dev/shm/573153/131/data
#2 ./bin/mysql_install_db --no-defaults --datadir=/dev/shm/573153/131/data
Suggested fix:
#1 Let mysql_install_db find mysqld in it's own (./) directory always
#2 Let mylsq_install_db find the basedir automatically if it is in one (i.e. no need to use --basedir option) and/or significantly improve output when it fails, .e. error user friendliness