0

I have a strange issue. On my PC with Linux Mint 17 I can access mysql just by typing mysql in the terminal, but on my laptop (with Ubuntu 15.04) I have to type each time /opt/lampp/bin/mysql (both have the latest XAMPP version installed).

So my question is: how to make mysql "global" and accessible by just typing "mysql"?

3 Answers 3

6

You need to add /opt/lampp/bin/ to your $PATH so that the system can find the binary file.

From the command line enter:

PATH=$PATH:/opt/lampp/bin
Sign up to request clarification or add additional context in comments.

Comments

2

+1 for doublesharp's answer. Otherwise, you could do:

alias mysql=/opt/lampp/bin/mysql

This avoids making everything in /opt/lampp/bin/ immediately accessible on the path, which may or may not be desired.

Comments

0

As said by @doublesharp, enter this line into the file .bashrc in your home directory

export PATH=$PATH:/opt/lampp/bin

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.