Unix Technical Forum

Path Environment Variable

This is a discussion on Path Environment Variable within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> I have just uninstalled and reinstalled MySQL Part of the installation required the directory to be added to the ...


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-20-2008, 07:27 AM
Murphy
 
Posts: n/a
Default Path Environment Variable

I have just uninstalled and reinstalled MySQL

Part of the installation required the directory to be added to the PATH
environment variable.

Being new to linux I would appreciate confirmation of the following command
as the last thing I want to do is screw up the existing path and have to
recreate it.

The MySQL manual states the following command should be issued:

setenv PATH ${PATH}:/usr/local/mysql/bin

The directory referenced in the command above is correct.


--
Thanks

Murph
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-20-2008, 07:27 AM
Laurenz Albe
 
Posts: n/a
Default Re: Path Environment Variable

Murphy <m@urphy.com> wrote:
> The MySQL manual states the following command should be issued:
>
> setenv PATH ${PATH}:/usr/local/mysql/bin


That is correct if and only if you (or MySQL) use it in a csh shell.
On other shells the following will work:

PATH=${PATH}:/usr/local/mysql/bin
export PATH

Yours,
Laurenz Albe
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-20-2008, 07:28 AM
Murphy
 
Posts: n/a
Default Re: Path Environment Variable

Laurenz Albe wrote:

> Murphy <m@urphy.com> wrote:
>> The MySQL manual states the following command should be issued:
>>
>> setenv PATH ${PATH}:/usr/local/mysql/bin

>
> That is correct if and only if you (or MySQL) use it in a csh shell.
> On other shells the following will work:
>
> PATH=${PATH}:/usr/local/mysql/bin
> export PATH
>
> Yours,
> Laurenz Albe


Thanks Laurenz for the prompt reply,

csh shell ?... I use it under KDE in the "Shell" windows as SU

I'm guessing "export PATH" displays the current value of the PATH
environment variable however when I issue this command nothing is
displayed, I would have expected some std values to be set for PATH or is
the default PATH value blank under Slackware/Linux ?

--
Thanks

Murph
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-20-2008, 07:28 AM
Laurenz Albe
 
Posts: n/a
Default Re: Path Environment Variable

Murphy <m@urphy.com> wrote:
>>> The MySQL manual states the following command should be issued:
>>>
>>> setenv PATH ${PATH}:/usr/local/mysql/bin

>>
>> That is correct if and only if you (or MySQL) use it in a csh shell.
>> On other shells the following will work:
>>
>> PATH=${PATH}:/usr/local/mysql/bin
>> export PATH

>
> csh shell ?... I use it under KDE in the "Shell" windows as SU


Hopefully (and probably) this is not a C shell.
Look at the output of 'ps' and you should know.

> I'm guessing "export PATH" displays the current value of the PATH
> environment variable however when I issue this command nothing is
> displayed, I would have expected some std values to be set for PATH or is
> the default PATH value blank under Slackware/Linux ?


From your response it is obvious that you know very little about
environment variables and shells in general.
That is ok, but you should read up on these things as they are ubiquitous
in Linux.

The shell is the command interpreter that runs inside your
KDE window. There are several, among them bash, ksh and csh.

If you start a program (e.g. MySQL), it inherits all environment variables.
Type 'setenv' in csh and 'export' else to get a list of all environment
variables.
In bsh-type shells you have to 'export' a variable to add it to the
environment.
These variables typically modify the behaviour of a program (PATH is
the search path for executables).

You can use 'echo $PATH' to display the current value of PATH.

It seems like you are trying to start MySQL as user 'root'.
I don't know if that is correct; read the documentation.
Never use root when you can avoid it.

Some pointers for further reading (apart form a web search):
'man bash', section ENVIRONMENT; the first paragraph of the PARAMETERS
section; and particularly the 'export' entry in the SHELL BUILTIN
COMMANDS section.

Yours,
Laurenz Albe
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-20-2008, 07:28 AM
John Bleichert
 
Posts: n/a
Default Re: Path Environment Variable

Laurenz Albe <albe@culturallnospam.com> wrote:
> Murphy <m@urphy.com> wrote:
>>>> The MySQL manual states the following command should be issued:
>>>>
>>>> setenv PATH ${PATH}:/usr/local/mysql/bin
>>>
>>> That is correct if and only if you (or MySQL) use it in a csh shell.
>>> On other shells the following will work:
>>>
>>> PATH=${PATH}:/usr/local/mysql/bin
>>> export PATH

>>
>> csh shell ?... I use it under KDE in the "Shell" windows as SU

>
> Hopefully (and probably) this is not a C shell.
> Look at the output of 'ps' and you should know.
>
>> I'm guessing "export PATH" displays the current value of the PATH
>> environment variable however when I issue this command nothing is
>> displayed, I would have expected some std values to be set for PATH or is
>> the default PATH value blank under Slackware/Linux ?

>
> From your response it is obvious that you know very little about
> environment variables and shells in general.
> That is ok, but you should read up on these things as they are ubiquitous
> in Linux.
>
> The shell is the command interpreter that runs inside your
> KDE window. There are several, among them bash, ksh and csh.
>
> If you start a program (e.g. MySQL), it inherits all environment variables.
> Type 'setenv' in csh and 'export' else to get a list of all environment
> variables.
> In bsh-type shells you have to 'export' a variable to add it to the
> environment.
> These variables typically modify the behaviour of a program (PATH is
> the search path for executables).
>
> You can use 'echo $PATH' to display the current value of PATH.
>
> It seems like you are trying to start MySQL as user 'root'.
> I don't know if that is correct; read the documentation.
> Never use root when you can avoid it.
>
> Some pointers for further reading (apart form a web search):
> 'man bash', section ENVIRONMENT; the first paragraph of the PARAMETERS
> section; and particularly the 'export' entry in the SHELL BUILTIN
> COMMANDS section.
>
> Yours,
> Laurenz Albe


Another good source for further reading is "UNIX In A Nutshell" from
O'Reilly. Good for sh/bash/ksh/csh shells, and is shorter than the
bash man page!

--------------------------------------------
John Bleichert - syborg@earthlink.net
"Conclamatum est, poculatum est"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-20-2008, 07:28 AM
Mike Denhoff
 
Posts: n/a
Default Re: Path Environment Variable

On Wed, 06 Apr 2005 11:26:39 +0000, Murphy wrote:

> I have just uninstalled and reinstalled MySQL
>
> Part of the installation required the directory to be added to the PATH
> environment variable.
>
> setenv PATH ${PATH}:/usr/local/mysql/bin
>
> The directory referenced in the command above is correct.


You might want to add to the PATH the way Slackware packages do it. They
put files in /etc/profiles.d which are run by the login scripts. For
example, the tetex package adds files tetex.sh (which is used if you shell
is bash) and tetex.csh (for csh). In the file tetex.sh is

#!/bin/sh
# Add PATH and MANPATH for teTeX:
PATH="$PATH:/usr/share/texmf/bin"
MANPATH="$MANPATH:/usr/share/texmf/man"

You could manually add a similar file for MySQL.

Mike

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-20-2008, 07:32 AM
Murphy
 
Posts: n/a
Default Re: Path Environment Variable

Mike Denhoff wrote:

> On Wed, 06 Apr 2005 11:26:39 +0000, Murphy wrote:
>
>> I have just uninstalled and reinstalled MySQL
>>
>> Part of the installation required the directory to be added to the PATH
>> environment variable.
>>
>> setenv PATH ${PATH}:/usr/local/mysql/bin
>>
>> The directory referenced in the command above is correct.

>
> You might want to add to the PATH the way Slackware packages do it. They
> put files in /etc/profiles.d which are run by the login scripts. For
> example, the tetex package adds files tetex.sh (which is used if you shell
> is bash) and tetex.csh (for csh). In the file tetex.sh is
>
> #!/bin/sh
> # Add PATH and MANPATH for teTeX:
> PATH="$PATH:/usr/share/texmf/bin"
> MANPATH="$MANPATH:/usr/share/texmf/man"
>
> You could manually add a similar file for MySQL.
>
> Mike


Is this the preferred method ?

--
Thanks

Murph
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:32 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com