Subject: | Fix for "Problem running c:\mysql\bin\MYSQLA~1.EXE - aborting ..." -- Windows specific |
When running Makefile.PL for DBD::mysql v4.013, I received the error:
"Problem running c:\mysql\bin\MYSQLA~1.EXE - aborting ..."
After peeking at the Makefile.PL file, I noticed that it executed
mysqladmin.exe with the parameter of 'version' to fetch the MySQLd
server version and TCP port details. This was failing and the MySQL
server showed in its query log why:
091121 4:06:30 86 Connect Access denied for user 'ODBC'@'localhost'
(using password: NO)
When configuring MySQL, I often secure the setup by removing the default
accounts using:
DROP USER ''@'%';
DROP USER ''@'localhost';
DROP USER 'root'@'127.0.0.1';
FLUSH PRIVILEGES;
Keeping 'root'@'localhost' and progressing from there onwards. This has
meant that mysqladmin.exe can nor longer login unless given a valid
username and password (else it tries to login as ODBC as shown above).
I therefore modified the Makefile.pl to bypass this issue, replacing:
Line 778:
my $v = qx($mysqladmin version);
With:
my $v;
if ( defined $opt->{'testuser'} and defined $opt->{'testpassword'}) ) {
$v = qx( sprintf('%s --user=%s --password=%s version', $mysqladmin ,
$opt->{'testuser'}, $opt->{'testpassword'}) );
} else {
$v = qx($mysqladmin version);
}
The patch makes use of login information for the optional test stage of
the module installation.
I feel the above patch may also help others who are inadvertently
experiencing the same problem as myself.
Thank you.
Kind regards,
Zeeshan.