Bug #56901 mysql_install_db does not handle --basedir with spaces in the path
Submitted: 21 Sep 2010 16:16 Modified: 8 Dec 2016 9:52
Reporter: Vemund Østgaard Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: Installing Severity:S3 (Non-critical)
Version:5.1.49, 5.1, 5.6.99 bzr OS:Any (SunOS 5.10 sparc ,Sun-Fire-V210, Linux)
Assigned to: CPU Architecture:Any

[21 Sep 2010 16:16] Vemund Østgaard
Description:
The mysql_install_db script fails when the --basedir option is used to specify a path containing one or more spaces. I've only tested on Solaris, but most likely applies to all unixes where the script is used.

Example with output:

/path with space/mysql-advanced-gpl-5.1.49-solaris10-sparc-64bit>./scripts/mysql_install_db --basedir="$PWD" -datadir=mydata
./scripts/mysql_install_db: /path: not found

FATAL ERROR: Could not find /path

If you compiled from source, you need to run 'make install' to
copy the software into the correct location ready for operation.

If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.

How to repeat:
Place a mysql installation in a directory with spaces in the path and try to run mysql_install_db using that location as the --basedir.

Suggested fix:
Handle paths with spaces.
[21 Sep 2010 17:53] Sveta Smirnova
Thank you for the report.

Verified as described.
[21 Sep 2012 21:57] Hartmut Holzgraefe
patch: allow spaces in basedir and datadir arguments

Attachment: bug56901.patch (text/x-patch), 3.69 KiB.

[8 Dec 2016 9:52] Yngve Svendsen
Posted by developer:
 
This is indeed a real issue, but with the time that has passed, the impact is much diminished: MySQL 5.7 and newer do not use mysql_install_db on any platform, and the main delivery vehicle for MySQL on Windows is the new MySQL Installer for Windows, which does not employ mysql_install_db for any version of MySQL. Weighing that against the risk and effort of fixing this properly, I am closing this as Not feasible to fix.