Setting a path alias for mysql on Ubuntu, with the XAMPP package

5,013

Solution 1

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.

Solution 2

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:
5,013

Related videos on Youtube

Danzzz
Author by

Danzzz

Updated on September 18, 2022

Comments

  • Danzzz
    Danzzz almost 2 years

    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?

  • Danzzz
    Danzzz almost 14 years
    The output is simply a suggestion of packages to install using apt-get, which might respond to the keyword.