Current directory does not play any role in choosing defaults file. You indeed need either to specify –defauilts-file, or set MYSQL_HOME, or the bdefault logic of finding my.ini will apply
On the other hand, I rarely find myself in need to use my.ini for clients. In doubt, I provide –port , and that’s all I need for the command line clients
From: Peter Laursen [mailto:peter_laursen@webyog.com]
Sent: Freitag, 27. September 2013 19:15
To: Vladislav Vaintroub
Cc: Maria Developers; Maria Discuss
Subject: Re: [Maria-developers] MySQL bug affects mariaDB
Thanks wlad for explanation, but this applies to 'shortcuts' (in start menu) only I think, as I understand your reply.
If I navigate ('cd ..') to the /datadir where my.ini resides and launch 'mysql' from commnd line I will need to specify --defaults-file on the command line, right? If not the client will start with defaults (or it will use whatever other my.ini it finds in C:\, C:\Windows or /basedir).
?
-- Peter
On Fri, Sep 27, 2013 at 7:06 PM, Vladislav Vaintroub <wlad@montyprogram.com> wrote:
The command line clients are not services, and they are not started with --defaults-file, this is correct.
But
1.We install shortcut to mysql client and shortcut does have --defaults-file , and the default-file points to the right place, i.e whenever you installed the mysql server instance
On my machine (I used the default x64 installation), MySQL client shortcut is this
C:\Windows\System32\cmd.exe /k " "C:\Program Files\MariaDB 5.5\bin\mysql.exe" "--defaults-file=C:\Program Files\MariaDB 5.5\data\my.ini" -uroot -p"”
2. Out installation also provides another shortcut – called Command Prompt( MariaDB …)
It could be used to call arbitrary client utilities, mysqladmin or somesuch .It uses yet another, less known, trick to force client utilities to look for correct my.ini - it sets environment variable MYSQL_HOME to point to the the datadir ( Besides, it also sets PATH to include “bin” directory, so that calling mysqladmin or mysql would not result in “path not found”)
The inspiration for this shortcut was a very similar feature of Visual Studio , the “Visual Studio 20xx Command Line”.
The summary of my.ini client-side support is that :
If you install with MSI, installer will create shortcuts that help client utilities to find correct my.ini . You can have multiple versions of the MariaDB installed, and the shortcuts will still work correctly – every version specific shortcut would point to version-specific my.ini
Thus, I’d argue that this bug does not affect MariaDB.
From: Maria-developers [mailto:maria-developers-bounces+wlad=montyprogram.com@lists.launchpad.net] On Behalf Of Peter Laursen
Sent: Freitag, 27. September 2013 10:06
To: Maria Developers; Maria Discuss
Subject: [Maria-developers] MySQL bug affects mariaDB
I think the 'mysql' client with MariaDB has a similar problem as it has with MySQL - refer?
MariaDB installer installs my.ini to /datadir - what with MariaDB is a subfolder to /basedir.
The server will look for it correctly as the registry key defining the service has a --default-file specification. But the command line clients don't read the registry key.
@Wlad?
-- Peter
-- Webyog