Can't find where the socket configuration is in XAMPP for Windows

polonskyg picture polonskyg · Nov 10, 2011 · Viewed 18.9k times · Source

I'm using Netbeans 7.0.1 in a PHP project.

I've installed XAMPP 1.7 in Windows 7 64 bits with the installer we can find in xampp.org. I've changed the port of apache from 80 and 443 to 81 and 442 since I'm using IIS as well. I didn't installed anything as a service, I'm using the Control Panel to start/stop mysql, apache, etc.

My problem is that my unit test are failing, and the context is that I'm developing the project with two guys who are working on Macs.

They have a configuration file with a line like this:

database_socket = /var/run/mysqld/mysqld.sock

My unit test are failing and they told me that one of them had the very same issue and changing that path to the correct one fixed his problem.

Now, Where is that file in the Windows XAMPP? I made a search in the whole hard drive (I know mysql must be running for that file to exists, and yes, it is running :)) and I couldn't find it.

This guy is using a file named Parameters.ini where the socket path is specified then he call $container = $kernel->getContainer(); and the database seems to be instantiated.

I tried to changed that file (parameters.ini) which has right now this:

database_host = localhost
database_socket = /var/run/mysqld/mysqld.sock
database_user = user
database_password = pass
database_schema = lad

but if I remove database_socket it complains.

I tried to follow the instructions here: http://www.devside.net/guides/windows/mysql Setup (changing www with xampp)

Unpack as C:\www\mysql-5.1.56-win32

Rename directory C:\www\mysql-5.1.56-win32 to C:\www\mysql

Copy MySQL configuration file C:\www\mysql\my-medium.ini (or your choice of one of the other included my-*.ini files) to your %SYSTEMROOT% directory

Rename file %SYSTEMROOT%\my-medium.ini (or the copied over my-*.ini file) to my.ini

Edit %SYSTEMROOT%\my.ini

Under Sections "[client]" and "[mysqld]", edit...

socket = C:/www/tmp/mysql.sock

Under Section "[mysqld]", insert...

basedir = C:/www/mysql/
datadir = C:/www/mysql/data/

Restarted mysql, but nothing happened.

Answer

polonskyg picture polonskyg · Nov 11, 2011

The solution is to put the socket line with an empty value.

socket = ""