1

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?

  • 1
    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
3

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
  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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