5

So I installed XAMPP (in Ubuntu), and it was successful,

the location of MYSQL is on, /opt/lampp/bin/mysql, and so I have to include the entire path to access mysql as seen below:

$/opt/lampp/bin/mysql -u root -p

And it can login.

But using just "mysql" isn't working; it says not found.

Can you give me an idea on how to set env't variable for mysql?

New in Ubuntu. help? :(

Sushi
  • 225
  • 1
  • 3
  • 6

1 Answers1

4

in your home directory there's a file called .bash_profile (use ls -la to see it because files starting with . are by default hidden

There will probably already be a line similar to this one:

PATH=$PATH:$HOME/bin

Change it to

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

This is the easiest way, there are other ways to eg do this so that all users on the system will automatically get this directory in their path, for more detailed answers go to our sister site askubuntu.com

Community
  • 1
  • 1
fvu
  • 31,143
  • 5
  • 57
  • 77
  • I tried that, but one more error appeared: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'. – Sushi Jul 01 '12 at 11:14
  • @Sue looks like your server might not be running, but I really think the remainder of this question should go to askubuntu.com – fvu Jul 01 '12 at 12:26
  • fvu, its working now!:) i just missed out to edit the my.cnf file and change the socket to /opt/lampp/var/mysql/mysql.sock. Thanks a lot for your help. :) – Sushi Jul 01 '12 at 12:59