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?

link|improve this question

feedback

2 Answers

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.

link|improve this answer
Thanks, thid did the trick – WebDevHobo Jul 2 '10 at 7:44
feedback

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

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

Your Answer

 
or
required, but never shown

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