0

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?

2 Answers 2

2

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.

0
1

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

1
  • The output is simply a suggestion of packages to install using apt-get, which might respond to the keyword.
    – KdgDev
    Jul 2, 2010 at 0:56

You must log in to answer this question.

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