Bug #29179 ReadMe file with OS X package is wrong about .bashrc file
Submitted: 18 Jun 2007 15:12 Modified: 13 Jul 2007 2:19
Reporter: Rob Lewis (Candidate Quality Contributor) Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.1.18 OS:MacOS (10.4.9)
Assigned to: Paul DuBois CPU Architecture:Any
Tags: .bashrc, bash, path, readme

[18 Jun 2007 15:12] Rob Lewis
The ReadMe.txt file that comes with the MacOS X installer package says this: 

Even better, add `/usr/local/mysql/bin' to your `PATH' environment
variable. For example, add the following line to your `$HOME/.bashrc'
file if your shell is `bash':


On my system at least, this doesn't work. 
However, it does work if I add the above line to the '~/.bash_profile' file, which I had to create. 
According to general *nix documentation I found on the web, .bashrc is supposed to be executed for "non-login" instances of the shell, while .bash_profile is only read for "login shells". Not being a *nix expert, I don't really know what this means (though I would like to know). 

How to repeat:
Add the line


to your .bashrc file, then open a new shell and type:

It doesn't work. Also, 
echo $PATH
will show that the extra path information was not picked up. 

Add the same line to .bash_profile, and it does work. 

Suggested fix:
Correct ReadMe.txt file (unless there are other issues that need to be fixed/resolved)
[18 Jun 2007 15:56] Sveta Smirnova
Thank you for the report.

Verified as described.

Strictly say these words are just a tip, not BASH user manual.

But according to BASH manual this phrase can be replaced with something like "For example, add the following line to your `$HOME/.bashrc' or `$HOME/.bash_profile' file if your shell is `bash':":

 When  bash is invoked as an interactive login shell, or as a non-inter-
       active shell with the --login option, it first reads and executes  com-
       mands  from  the file /etc/profile, if that file exists.  After reading
       that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile,
       in  that order, and reads and executes commands from the first one that
       exists and is readable.  The --noprofile option may be  used  when  the
       shell is started to inhibit this behavior.

       When  a  login  shell  exits, bash reads and executes commands from the
       file ~/.bash_logout, if it exists.

       When an interactive shell that is not a login shell  is  started,  bash
       reads  and executes commands from ~/.bashrc, if that file exists.  This
       may be inhibited by using the --norc option.  The --rcfile file  option
       will  force  bash  to  read  and  execute commands from file instead of
[13 Jul 2007 2:19] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.

I've rewritten the setting-environment-variables section
to include the material from the Mac OS X section on setting PATH. The
section mentions both .bashrc and .bash_profile.

I also removed the PATH-setting stuff from the Mac OS X section and added
a pointer from there to the environment variable section, which is really
whether that material properly goes.