Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .