special chars
This script failed when the user tried passwords with multiple spaces, \, # or
' characters. Now proper escaping and quoting is used in all contexts.
This problem occurs in the Perl version of this script, too, so fix it in both
places.
Term::ReadKey"
Add the missing module import. Also, while here, fix a few glaring problems
with the script, and ensure that it behaves properly. It seems this script
may have never been working correctly (e.g., reading password didn't chomp()
the result, so password was set with \n at the end; comparing the re-typed
password to original was done with inverted test).
Add END { cleanup(); } block to ensure the script removes temporary working
files.
Add SIG{INT} / SIG{QUIT} handler.
Do a bit of reorganization to make the code easier to understand.
Limit failed connection attempts to 3.
Use ./bin/mysql if it exists, and then fall back on mysql in PATH (before it
assumed 'mysql' in the path). Print a nicer error if 'mysql' can't be called.
This has been tested on Windows (ActivePerl from cmd.exe, no cygwin needed)
and Linux.
Added Perl version of script "mysql_secure_installation"
make_win_bin_dist:
Corrected copy of SQL files to "share" directory
scripts/mysql_secure_installation.pl.in:
Added Perl version of script "mysql_secure_installation"
scripts/CMakeLists.txt:
Added Perl version of script "mysql_secure_installation"
scripts/Makefile.am:
Added Perl version of script "mysql_secure_installation"
scripts/make_win_bin_dist:
Corrected copy of SQL files to "share" directory