Bug #8939 Setting Environment Variables in sh,zsh,bash
Submitted: 4 Mar 2005 4:17 Modified: 4 Mar 2005 16:11
Reporter: Michael Spang Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:Current OS:n/a
Assigned to: Paul DuBois CPU Architecture:Any

[4 Mar 2005 4:17] Michael Spang
Description:
Section 4.3.3 (http://dev.mysql.com/doc/mysql/en/environment-variable-options.html) of the mysql documentation has incorrect instructions for setting environment variables in sh and zsh.

A comment of mine was recently merged which explained that bash required a user to use the 'export' built-in command to set environment variable in bash. I have discovered after some research that this is also true for sh and zsh.

How to repeat:
With ZSH:
Tyr% MYSQL_HOST=foo
Tyr% mysql
ERROR 1045 (28000): Access denied for user 'mike'@'localhost' (using password: NO)
Tyr% export MYSQL_HOST=foo
Tyr% mysql
ERROR 2005 (HY000): Unknown MySQL server host 'foo' (1)

With SH (dash):
$ MYSQL_HOST=foo
$ mysql
ERROR 1045 (28000): Access denied for user 'mike'@'localhost' (using password: NO)
$ export MYSQL_HOST=foo
$ mysql
ERROR 2005 (HY000): Unknown MySQL server host 'foo' (1)

Suggested fix:
Update the documentation, merging the example for bash and the example for sh and zsh.
[4 Mar 2005 16:11] 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
product(s).