1

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)

3
  • Is your mysql server running ? Can you do /etc/init.d/mysqld status ? What does it say ?
    – Abhinav
    Jun 13, 2010 at 18:52
  • This was cross posted on Stackoverflow.
    – Warner
    Jun 13, 2010 at 18:59
  • the mysqld is not running!
    – Imran
    Jun 13, 2010 at 19:11

1 Answer 1

1

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.

2
  • this assumes you have sudo rights? Feb 7, 2021 at 2:46
  • No. That' a user crontab line. The system crontab would also have a field for what user to run it as. Anyone should be able to create files in /tmp, and it should work unless you've got some sort of security stuff running that restricts applications from using stuff in /tmp or enforces symlinks to have the same ownership as the thing they're linking. (I personally gave up on SElinux extensions, so have no idea what it might complain about)
    – Joe H.
    Feb 10, 2021 at 16:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .