Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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'm trying to import a database from Wamp to Xampp. I run Lampp first, then go to /opt/lampp/bin and run:

mysql (or mysqladmin ?) -u root -h localhost

but I get:

mysql: command line not found

Why isn't it working?

share|improve this question
Does this answer your question? I'm not quite sure what the actual problem is – Michael Mrozek May 10 '12 at 21:02
Also check this up here if you are fed up to input your password and username. Hopefully this saves some time to get started and early trial-and-error. – user2362 May 10 '12 at 23:39
here‌​'s a similar question with some things to try and some questions to get you on the way. – Bram May 11 '12 at 7:08
up vote 3 down vote accepted

Typically the current directory (.) is not inside the PATH for security reasons (assume a user puts an evil executable called ls in /tmp and then root executes it ...).

You can either call it explicitly:

./mysql -uroot -hlocalhost

Or you could add the folder to your PATH:

export PATH=/opt/lampp/bin:$PATH
mysql -uroot -hlocalhost
share|improve this answer
Thank you Johannes, That really helped me, in every tutorial I red, they didn t put the ./ that is used for the cd command. Once again, easy, but you can't guess it if you don't know it :) I'm really wonderinng why all the guides I red didn't talk about it... like here for instance – Miles M. May 11 '12 at 14:30
That tutorial uses the package mananger (yum) to install mysql, which puts the mysql in7bin(or rather /usr/bin) which is in $PATH. Other tutorials might be like "yeah well, I didn't think much, but the user will know" which obviously isn't always the case .. – johannes May 11 '12 at 21:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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