Setting up XAMPP and MySQL

bigsaucybob

New Member
What's up CF?

It has been many years since I have posted on here, but the problem at hand has warranted the need for some good advice.

Anyway, I am in the process of working through a guidebook on PHP and MySQL. I have been using XAMPP to run .html and .php files locally on my Mac. But the time has come for me to connect to mysql server. I have written a .php file to do so, but when I try to run it via my browser, I get this error message:

Error connecting to database: Can't connect to local MySQL server through socket '/Applications/XAMPP/xamppfiles/var/mysql/mysql.sock' (2)

From what I understand, in order to use XAMPP and MySQL together, I need to redirect it to the location of this file. However, the most significant problem I am having so far is locating the mysql.sock file.

I can't find it anywhere. I have looked in /tmp and within /Applications/XAMPP with no luck.

I was hoping some knowledgeable individual from CF could point me in the right direction, for I have scoured the internet for an answer to this problem with no avail.

Thanks in advance for any assistance.
 

legalize

New Member
How are you trying to connect? Have you set up mySQL when setting up xampp? You can do it through xampp's control panel I believe.

Try this for setting xampp up correctly... It should just work!
 
Top