Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've installed XAMPP, and now want to set an alias so that I can open the commandline mysql client with just a single command.

Right now I have to type /opt/lampp/bin/mysql -u root -p every time. So I did this.

nano /root/.bashrc

Add the line:

alias mysql='/opt/lampp/bin/mysql -u root -p'

And saved. Sadly, it isn't working. What should I do to accomplish what I am trying?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

If you just made that change, it doesn't take affect right away. You either need to start a new shell or type source ~/.bashrc.

I take it you are running this command as root? Or are you running it with sudo?

You should be putting this in your user directory if you are running this command as a user.

share|improve this answer
    
Thanks, thid did the trick –  KdgDev Jul 2 '10 at 7:44

When you say "isn't working" you need to provide more info. Without seeing what your exact error message is, a good answer is not possible. Are you logged in as root? Paste the output when it fails.

Regardless of that, why not just add /opt/lampp/bin/ to your PATH? PATH="$PATH:/opt/lampp/bin" in your .bashrc

share|improve this answer
    
The output is simply a suggestion of packages to install using apt-get, which might respond to the keyword. –  KdgDev Jul 2 '10 at 0:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.