Bug #59500 mysql_install_db.pl does not work as expected on windows
Submitted: 14 Jan 2011 13:05
Reporter: Thomas Nielsen Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S1 (Critical)
Version:7.1.9a OS:Microsoft Windows
Assigned to: CPU Architecture:Any
Triage: Triaged: D3 (Medium) / R6 (Needs Assessment) / E3 (Medium)

[14 Jan 2011 13:05] Thomas Nielsen
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