Description:
Running the mysql_install_db.pl script on windows fails on windows for two reasons:
1) it does not match the current implementation of mysql_install_db.sh regarding options on the mysqld --bootstrap step.
2) missing $resolveip variable initialization in perl script, and illegal commandline for the resolveip call.
Running mysql_install_db.pl fails with the following due to 2):
'xxxxxxxx' is not recognized as an internal or external command,
operable program or batch file.
FATAL ERROR: Neither host 'xxxxxxxx' nor 'localhost' could be looked up with
u:/cluster-7.1.9a/bin/resolveip
Please configure the 'hostname' command to return a correct
hostname.
If you want to solve this at a later stage, restart this script
with the --force option
Running the resolveip application manually works as expected, and script inspection revealed missing variable initialization.
How to repeat:
Run:
U:\cluster-7.1.9a\bin>perl u:\cluster-7.1.9a\scripts\mysql_install_db.pl --defaults-file=g:\data\mycluster\4\cfg\my.cnf --datadir=g:\data\mycluster\4\data --basedir=u:\cluster-7.1.9a
'xxxxxxxx' is not recognized as an internal or external command,
operable program or batch file.
FATAL ERROR: Neither host 'xxxxxxxx' nor 'localhost' could be looked up with
u:\cluster-7.1.9a/bin/resolveip
Please configure the 'hostname' command to return a correct
hostname.
If you want to solve this at a later stage, restart this script
with the --force option
Suggested fix:
Suggested fixes:
1) use same options as current mysql_install_db.sh script
2) initialize $resolveip variable correctly, and remove stderr redirect which won't work on windows