-
Bug
-
Resolution: Cannot Reproduce
-
Low
-
None
The Windows installer for Moodle (specifically tested with version 4.5.1+ from the MoodleWindowsInstaller-latest-405 package, but may affect other versions) contains an incorrect default datadir setting in the my.ini file located at server/mysql/data/my.ini. This misconfiguration prevents MySQL from starting correctly, leading to a failed Moodle installation.
Problem
The default my.ini file included with the installer contains the following setting under the [mysqld] section:
[mysqld]
|
datadir=c:/xampp/mysql/data
|
This path is likely a generic placeholder and does not reflect the actual data directory used by the Moodle-XAMPP installation. The path appears to be relative to an assumed XAMPP installation directory, which may not be valid for all users, especially if they choose a custom installation path.
Due to the incorrect datadir, MySQL fails to initialize the InnoDB storage engine and returns an error: Can't find mysql\data\mysql.pid.
Expected Behavior
The my.ini file should either:
- Use a correct, dynamically generated absolute path for datadir that reflects the user's chosen installation directory.
- Use a path relative to the MySQL base directory, ensuring portability.
Temporary Workaround
Users can manually correct the datadir setting in my.ini by replacing the default value with the absolute path to the actual MySQL data directory within their Moodle installation. For instance:
[mysqld]
|
datadir=<Moodle_Installation_Root>/server/mysql/data
|
Where <Moodle_Installation_Root> should be replaced with the actual root directory of the Moodle installation.
Possible Solution
The Moodle Windows installer should be updated to generate the my.ini file with a correct datadir setting, either by using an absolute path based on the user's installation directory or a path relative to a well-defined base directory within the Moodle installation.
- has been marked as being related by
-
MDLSITE-7880 Decide what to do with our Windows and Mac OS packages
-
- Reopened
-