Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

Can someone please help as i've spent all day trying to fix this. I installed the latest XAMPP and now i can't connect to mysql from terminal.I checked my .profile file and the PATH seems ok. Does anyone know whats happened and what's the solution?

PATH=$PATH:/Applications/XAMPP/xamppfiles/bin export PATH


Thankyou soo much in advance;-)

UPDATE: the solution was to update the .bash_profile with (as well as the .profile file)

PATH=$PATH:/Applications/XAMPP/xamppfiles/bin export PATH

spent the whole day trying to work this out so i hope this helps anyone in the same position ;-) (GOOD LINK)

share|improve this question
Is your mysql server running ? Can you do /etc/init.d/mysqld status ? What does it say ? – Abhinav Jun 13 '10 at 18:52
This was cross posted on Stackoverflow. – Warner Jun 13 '10 at 18:59
the mysqld is not running! – Imran Jun 13 '10 at 19:11

This can be one of two problems -- mysql isn't running, or mysql isn't putting the socket file in /tmp.

If the mysql command line program works, then the database is up, and it's just that php is compiled w/ the wrong location for the socket file. If it were in any *other* place, you'd get by with just adding a symlink from the place PHP is looking to the correct place, but because /tmp is cleared on reboot, you'll either need to change the my.cnf to write it to /tmp (possibly breaking other things), or you'll need to re-compiled PHP w/ the option for it to look in the right place, or you can add the following to cron:

@reboot ln -s /var/mysql/mysql.sock /tmp/mysql.sock

... adjusting /var/mysql/mysql.sock for wherever the correct location is.

If mysql isn't running, the common problems are either that it's not set to launch after reboot, or it's run into some error. Check the error logs for any information, and if there's nothing in there since the last reboot, you'll need to do whatever your flavor's preferred method is to set it to start on reboot.

share|improve this answer

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.