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?

Michael Mrozek
  • 93,103
  • 40
  • 240
  • 233
Miles M.
  • 295

1 Answers1

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
johannes
  • 271
  • 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