Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

THIS IS A PROGRAMMING QUESTION AS I'M A PHP DEVELOPER TRYING TO DO MY JOB!

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 ;-) http://www.jroller.com/jnicho02/entry/setting_up_xampp_on_the (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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.