-
Q:
alias toevoegen in /etc/profile lukt niet
Hallo,
Ik heb mysql geïnstalleerd en wil dat alle gebruikers “mysql” kunnen oproepen. Voor één gebruiker lukt dit door gewoon “alias mysql=/usr/local/mysql/bin/mysql” toe te voegen in ~/.profile
Nu, om dit voor alle gebruikers te doen zou dit normaal moeten gaan door dezelfde regel toe te voegen in /etc/profile, dit lukt echter niet. Kan iemand mij helpen?(probleem nu is eigenlijk dat ik geen bash-scripts kan uitvoeren die gebruik maken van mysql, omdat ze het niet kunnen oproepen)
Alvast bedankt
Pib”mcstream”let op de kwootjes: alias mysql=”/usr/local/mysql/bin/mysql”
suc6
helpt helaas ook niet, dit is mijn volledige /etc/profile:
[code:1:da32f7faf1]# System-wide .profile for sh(1)PATH="/bin:/sbin:/usr/bin:/usr/sbin"
export PATHalias mysql="/usr/local/mysql/bin/mysql"
if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
## setloginpath added /usr/local/bin start at Sun Aug 7 11:03:58 CEST 2005
## Do not remove the previous line
if [ `whoami` != "root" ]
then
PATH="$PATH:/usr/local/bin"
export PATH
fi
## Do not remove the next line
## setloginpath added /usr/local/bin end at Sun Aug 7 11:03:58 CEST 2005
## TeX modifications start at Sun Aug 7 11:17:11 CEST 2005
## Do not remove the previous line
if [ `whoami` != "root" ]
then
PATH="$PATH:/usr/local/teTeX/bin/powerpc-apple-darwin-current"
export PATH
fi
## Do not remove the next line
## TeX modifications end at Sun Aug 7 11:17:11 CEST 2005[/code:1:da32f7faf1]Pib
Dit is mijn /etc/profile
# System-wide .profile for sh(1)
PATH=”/bin:/sbin:/usr/bin:/usr/sbin”
export PATHalias testje=”/usr/bin/vi”
[ -r /etc/bashrc ] && source /etc/bashrc
Als ik een nieuwe terminal open en ik tik testje in start de vi editor
het werkt dus wel, let er wel op dat na het aanpassen van /etc/profile
je een nieuwe terminal opent anders zit je nog met de oude gegevens
uit de vorige /ec/profile.Wat je ook zou kunnen doen is het path naar mysql toevoegen aan PATH
PATH=”$PATH:usr/local/mysql/bin/mysql”
export PATHPlaats de regels boven de regel met:
## Do not remove the next line
Om te controleren of het gelukt is kun je in de terminal echo $PATH intikken,
ook hier geldt dat je een nieuwe terminal moet openen anders werkt het niet.Er is ook nog een /private/etc/profile wellicht heb je hier iets aan.
Suc6
Met PATH=”$PATH:/usr/local/mysql/bin/” lukt het, bedankt!
Werkt bij jou dat “testje” ook als je als root bent ingelogd? Want dat gaat bij mij nog steeds niet, testje werkt dan enkel als ik gewoon als gebruiker ben ingelogd.
Maar de oplossing met path gaat dus wel en daarmee is mijn probleem opgelost, is enkel nog ter info…heel erg bedankt hoor!
Pib
Je moet ingelogd zijn om een reactie op dit onderwerp te kunnen geven.