Bug #38073 new default <datadir> does not globally apply
Submitted: 12 Jul 2008 17:59 Modified: 15 Oct 2012 14:51
Reporter: Peter Laursen (Basic Quality Contributor) Email Updates:
Status: Unsupported Impact on me:
None 
Category:MySQL Server: Installing Severity:S2 (Serious)
Version:5.1.26 OS:Windows (Vista32)
Assigned to: Assigned Account CPU Architecture:Any
Tags: qc

[12 Jul 2008 17:59] Peter Laursen
Description:
I did a fresh install of 5.1.26 (installer/config wisard issues reported elsewhere). The configuration file I used for a start was the my-medium template shipped with the server. It was simply renamed to 'my.ini'.

Trying to start the server failed with the attached error. 

I noticed that the /datadir was created by installer in \Program Data... as what is expected on Windows with recent versions.  There was no explicit <datadir> setting in configuration/my.ini.  So I would expect the server in every respect to use the /datadir created in \program data as it is now default for MySQL server on Windows.  

But to get rid of the error and to be able to start the server I needed to add a datadir setting in .ini pointing to \Program Data.. 

How to repeat:
see above ...

Suggested fix:
I have no better idea either! :-)
[12 Jul 2008 18:00] Peter Laursen
Server is trying to use non-existing /datadir

Attachment: datadir.jpg (image/jpeg, text), 24.41 KiB.

[12 Jul 2008 19:31] Peter Laursen
I actually would consider raising severity to S2. But you can decide on that!  

Though such issue is trivial for experienced users it is enough to effectively prevent new and unexperienced users getting started! And all the issues with recent installers for Windows are annoying 'time-eaters' for everybody!
[14 Jul 2008 10:17] Susanne Ebrecht
Many thanks for reporting a bug.

I think the problem is that Windows not always has a \Program directory. On my Windows this directory is named \Programme because my Windows is German. And I am pretty sure Windows from other countries these directory will have more different names.

So it would be very difficult for us to give a default path here. But I will ask for a second opinion here.
[14 Jul 2008 11:26] Peter Laursen
This is not the problem, I think! 

'Program Files' folder has localized names with most non-english Windows. That is true.  But irrelevant! It should simply not attempt to access a /datadir in that folder tree at all (unless an explicit datadir setting points there)!  It should

1) First check if an explicit datadir setting is is configration (as a --startup parameter or as a setting in my.ini (and this it acutally does. When the datadir is explicitly set in my.ini pointing to the physical datadir the server will start)

2) If not use the default that points to the /programdata folder tree (and not to /program files folder tree). This is wehre the bug is!

It is obvious I think that the path to Program Files folder tree is simply a wrong (hardcoded) default setting with this release. Whether the English path is hardcoded or the placeholder %programs% is used is not important!  It is wrong in either case!

It is also a part of this story, that from Windows Vista, the localisation concept of Windows has changed.  Now localised names will appear in the GUI, but from command line localized distributions accepts English path (an localized paths sometimes does not work from command line actually, what may be a bug with Windows!).  But also not relevant really.  The bug is much more trivial, I believe.  *somebody* simply hardcoded a wrong/abandoned default path somewhere!

I feel like to add that you do not seem to know much about Windows and about MySQL on Windows! And in particular about the important change recently that all not read-only files are not written to /program files any more as default.  The reason is that from Windows Vista a non-admin user does not have write access here if the 'User Account Control' feauture is turned on. 

But I must assume that you know all those details??
[16 Jul 2008 6:13] Susanne Ebrecht
Peter,

ahhhh, sorry I totally misunderstood you.

The same problem exist by using Unix/Linux with /etc/mysql.

The order where to find the my.cnf should be changed and the daemon should not look if there is a given base dir/data dir in an older or system installed my.cnf. It should only take care of given my.cnf and if there is no basedir/data dir given, it should look if it is in default tree.
[26 Oct 2008 12:33] Peter Laursen
We just had a 100-day aniversary her, so I would like to know how it goes?
[31 Oct 2008 15:05] Susanne Ebrecht
This is related to all operating systems.

The problem is that the deamon start script always first will look into /etc or /etc/mysql and not first will look into installed directory.
[7 Nov 2008 13:52] Susanne Ebrecht
Peter,

sorry, I totally misunderstood this bug report.

I understood that you complain about the windows specification for this:

Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf <installation path>/etc/my.cnf ~/.my.cnf

Right order should be:
~/.my.cnf <installation path>/etc/my.cnf /etc/my.cnf /etc/mysql/my.cnf 

But I figured out you complained about search order for datadir.

This should be:
1) look at the installation path
2) look into my.ini (according to given order of my.ini order)
[2 Oct 2010 8:08] Peter Laursen
From a reply in another report of mine I think I understand that this is a "won't fix" ?